idiotbear
07-11-2003, 06:29 AM
hi
I want to have the submit button on my form disabled until a bunch of fields are filled out.
How do I express this? I'm fairly new to proper JS, so bear with me!
I was thinking along the lines of
function validate()
{
if document.forms[0].amount.value == "" ||
document.forms[0].account.value == "" ||
document.forms[0].startdate.value == "" ||
{
document.forms[0].submit.disabled = true }
else {
document.forms[0].submit.disabled = false }
}
I'm planning to call this on the onchange of each of the affected fields.
I know the above isn't right, but I don't know why - very inexperienced in JS logic and syntax.
I'd appreciate some help!
I want to have the submit button on my form disabled until a bunch of fields are filled out.
How do I express this? I'm fairly new to proper JS, so bear with me!
I was thinking along the lines of
function validate()
{
if document.forms[0].amount.value == "" ||
document.forms[0].account.value == "" ||
document.forms[0].startdate.value == "" ||
{
document.forms[0].submit.disabled = true }
else {
document.forms[0].submit.disabled = false }
}
I'm planning to call this on the onchange of each of the affected fields.
I know the above isn't right, but I don't know why - very inexperienced in JS logic and syntax.
I'd appreciate some help!