July 23, 201016 yr Just a pretty easy question. I have a series of input field that have an "onChange" action on them which call a function. I know I can pass a value the function such as "onChange="updateForm(contact_name);"" However how do I then get this value when the function is run and how can I save it as a variable? function updateForm() { }
July 23, 201016 yr What is the updateForm function going to do? Insert a value in to another element? Let us know what you're trying to achieve with the function...
July 23, 201016 yr Just a pretty easy question. I have a series of input field that have an "onChange" action on them which call a function. I know I can pass a value the function such as "onChange="updateForm(contact_name);"" However how do I then get this value when the function is run and how can I save it as a variable? function updateForm() { } Well to get a form field value u could do this give ur form an id like form or what ever id name then heres the javascript var = formname.field_name.value; Im not sure if this is what u were meaning sorry if it was not
July 23, 201016 yr Author The function takes the value from an input field and checks it against a list to see if it matches. I'm using ajax to do this but I want to only use the one function. Therefore each time I call the function I want to pass the input name as an arguement. I was just wondering how to do this.
Create an account or sign in to comment