I made this function:
function alertvalue(number){
alert(document.formname.number.value);
}
when i call the function: alertvalue("field6")
and i have <input name="field6" value=http://www.webdeveloper.com/forum/archive/index.php/"right"> somewhere in my document, it SHOULD alert "right"
BUT that doesnt work, it tries to alert the value of the field named "number" instead of "field6"
so how can i use the variable "number" in the field name?
something needs to be changed in "alert(document.formname.number.value);", but I dont know how to do it, could anyone help me plz?
function alertvalue(number){
alert(document.formname.number.value);
}
when i call the function: alertvalue("field6")
and i have <input name="field6" value=http://www.webdeveloper.com/forum/archive/index.php/"right"> somewhere in my document, it SHOULD alert "right"
BUT that doesnt work, it tries to alert the value of the field named "number" instead of "field6"
so how can i use the variable "number" in the field name?
something needs to be changed in "alert(document.formname.number.value);", but I dont know how to do it, could anyone help me plz?