onsubmit: picking up html variables in function call?

DaveC

Member
Joined
Jun 4, 2008
Messages
63
Reaction score
0
Points
6
Using javascript onSubmit. want to pass in variables from HTML into function called by onSubmit...can't even get this to compile no less run it,
Compiler says that the vars are not resolved, e.g.

<FORM name="myForm" method="POST" action="Controller" onsubmit="myFunc("'+myId+'","'+myOrderNumber+'");">

How to fix this syntax to resolve these vars: myId and myOrderNumber from the HTML below? Also the syntax is still a bit off too for parentheses.
 
What I'd like to know is why in the hell are you compiling Javascript and HTML while they are client-side interpreted languages :|
 
Back
Top