M
Mark Hannon
I have been researching the "disabled" property for form data and
wanted to know:
- Does the disabled property supress the form item from being submitted?
- Can the disabled property be applied when the submit button is
pressed?
I am designing a PayPal order page that will have 4 items, each with a
3-character text box where the customer will enter quantity. The
default value will be "0." I want to be able to test whether the
quantity is greater than 0. If it isn't, then I want to disable the
form fields attached to that item so that they don't even appear in the
final statement.
This is my idea, let me know if this will work the way I want:
function tally(){
if(document.orderform.quantity.value == 0){
document.orderform.quantity.disabled = true;
} else{
document.orderform.quantity.disabled = false;
}
// repeat for next 3 items
//
// the rest of the tally code continues below
}
wanted to know:
- Does the disabled property supress the form item from being submitted?
- Can the disabled property be applied when the submit button is
pressed?
I am designing a PayPal order page that will have 4 items, each with a
3-character text box where the customer will enter quantity. The
default value will be "0." I want to be able to test whether the
quantity is greater than 0. If it isn't, then I want to disable the
form fields attached to that item so that they don't even appear in the
final statement.
This is my idea, let me know if this will work the way I want:
function tally(){
if(document.orderform.quantity.value == 0){
document.orderform.quantity.disabled = true;
} else{
document.orderform.quantity.disabled = false;
}
// repeat for next 3 items
//
// the rest of the tally code continues below
}