Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

Javascript

I have a form like this:

<form method="post" name="st" action="cust_updt.php" onSubmit="return chk_vals();">

Something wasn't working in the subsequent page so I put a few alerts into the chk_vals function; see attached.

The alerts do NOT display

From my past experience, there is probably something wrong with this or other javascript on the page. I turned on FireFox WebConsole & ran it again; nothing.

How can I debug the Javascript; there is more above the chk_vals function, I suspect the error is there?

Thanks
chk-vals.js
Avatar of Big Monty
Big Monty
Flag of United States of America image

do you have Chrome installed? I find their Developers Console really easy to use, especially with javascript errors.

can you provide a link to the page?
ASKER CERTIFIED SOLUTION
Avatar of OriNetworks
OriNetworks

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of OriNetworks
OriNetworks

Also I'm not sure what you're trying to do with <?  ?> but that is invalid syntax as well unless you have some other component overwriting those values.  

document.st.action = "cust_wonsn.php?cid=" + cid + "&pstr="<? print $pstr; ?> + "&type="<? print $type; ?>;

temporarily change it to

document.st.action = "cust_wonsn.php?cid=" + cid + "&pstr=&type=";

Open in new window


JavaScript syntax validator:
http://esprima.org/demo/validate.html
Avatar of Richard Korts

ASKER

Of course I looked right at those & didn't see it.

On the <?   ?>, that is php, I'd forgotten that was in there; that gets resolved on the server.

Thanks