I want to create a function that will change the value of a text box. The hard part is passing the variables to the function and having it know that it's a variable, not the name of a textbox!
For example, if I have a textbox named "box1" and I want to change the status to "Current", I could use
changeStatus('box1','Current')
How do I call that in the document.flightpurchase.???.value
function changeStatus(name,status) {
document.flightpurchase. + name + .value = status
}
For example, if I have a textbox named "box1" and I want to change the status to "Current", I could use
changeStatus('box1','Current')
How do I call that in the document.flightpurchase.???.value
function changeStatus(name,status) {
document.flightpurchase. + name + .value = status
}
Comment