Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

javascript function

Featured Replies

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() {

}

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... :)

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 :)

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.