A
Andrew Falanga
Hi,
Well, I'm learning slow but sure. I'm having a different problem
now. Basically, I have a function (my form validation function, that
I want to be able to abstract into a library. That means, I want the
function to work on any form it's called on. The function will take
two arguments. The first is the form object itself and the second is
a comma separated list of names that may be NULL of all the input
elements in the form.
What I'm having trouble with is the syntax of the html to associate
this function to the onsubmit attribute of the form. This is what
I've got:
<form id="NewPatientForm" onsubmit="return CheckFormValues(this,
comments,husband_lastName,husband_firstName)" action=<?PHP echo
($_SERVER['PHP_SELF'] . "?new=insert"); ?> method=post>
Which obviously isn't going to work because each of those commas will
be interpreted as separate arguments to the function. I put it
quotes, but then ended up with an HTML syntax error when the page is
loaded (thanks to whomever it was here that informed me of the "Error
Console" in Firefox, man, that's just awesome). So, how do I pass
this comma separated list of values into this function?
Thanks,
Andy
Well, I'm learning slow but sure. I'm having a different problem
now. Basically, I have a function (my form validation function, that
I want to be able to abstract into a library. That means, I want the
function to work on any form it's called on. The function will take
two arguments. The first is the form object itself and the second is
a comma separated list of names that may be NULL of all the input
elements in the form.
What I'm having trouble with is the syntax of the html to associate
this function to the onsubmit attribute of the form. This is what
I've got:
<form id="NewPatientForm" onsubmit="return CheckFormValues(this,
comments,husband_lastName,husband_firstName)" action=<?PHP echo
($_SERVER['PHP_SELF'] . "?new=insert"); ?> method=post>
Which obviously isn't going to work because each of those commas will
be interpreted as separate arguments to the function. I put it
quotes, but then ended up with an HTML syntax error when the page is
loaded (thanks to whomever it was here that informed me of the "Error
Console" in Firefox, man, that's just awesome). So, how do I pass
this comma separated list of values into this function?
Thanks,
Andy