PDA

View Full Version : easy setting value question?


charbort
02-07-2003, 03:13 PM
I am trying to set the value of the hidden field "Email" from the "email" value inputed in the form. I know it should be easy, but it's not working for some reason.

Any ideas?

Thanks,
C

<SCRIPT LANGUAGE="JavaScript">
<!--
function setEmail(){
document.checkbox_form.Email.value = document.checkbox_form.email.value;
}
//-->
</script>

----form code-----
<form onsubmit="setEmail; return checkbox_checker(this)" name="checkbox_form">
<!-- hidden fields for form processing -->
<input type=hidden name="required" value="firstName,lastName,email">
<input type=hidden name="sort" value="order:firstName,lastName,address,city,state,zip,phone,email">
<input type=hidden name="Email" value="empty">

<input name="email" type="text" id="email" size="35">

Adam20002
02-07-2003, 03:20 PM
hi,

first thing i to noticed is the lack of brackets () on the setEmail function call



----form code-----
<form onsubmit="setEmail() ; return checkbox_checker(this)" name="checkbox_form">
<!-- hidden fields for form processing -->
<input type=hidden name="required" value="firstName,lastName,email">
<input type=hidden name="sort" value=" order:firstName,lastName,address,city,state,zip,ph
one,email">
<input type=hidden name="Email" value="empty">

<input name="email" type="text" id="email" size="35">

whammy
02-08-2003, 12:08 AM
Also, it's probably syntactically OK to use "Email" and "email" in javascript and some other C-type languages since they are case-sensitive, but I still find it confusing personally - I'd use a more descriptive name for the hidden field like "hidden_email" or something. Just a suggestion. :)