vectorfrog
07-31-2008, 11:30 PM
Hi, I have a page with tons of forms (each represents a product) that look almost exactly alike, the only difference is the name of the form. I'd like to create a function that will reset the value of one of the hidden feillds in the form based on a dropdown box. I know how to do this by using the specific DOM reference such as:
document.testform.price.value = document.testform.size_choice.value;
however, since I have so many forms that use the exact same hidden and dropdown names (price and size_choice), is there a way I can create 1 function where I pass the different form names? For instance:
function setPrice(form_name){
document.form_name.price.value = document.form_name.size_choice.value;
}
I'm sure there must be a way, but I'm not having any luck finding it. Please forgive my newbiness ;)
document.testform.price.value = document.testform.size_choice.value;
however, since I have so many forms that use the exact same hidden and dropdown names (price and size_choice), is there a way I can create 1 function where I pass the different form names? For instance:
function setPrice(form_name){
document.form_name.price.value = document.form_name.size_choice.value;
}
I'm sure there must be a way, but I'm not having any luck finding it. Please forgive my newbiness ;)