Is it possible to run to functions at the same time when using onchange?

Now i have this one:

<select name="hovedside_id" onchange="hentPosition(this.value)">

Using ajax i get updated another dropdown list with db info from this function just above.

I return the data to a span tag with an id.

But i need to update the page in two places when a change has happened in the drop down list.

So i can not get the additional info i need when a change has happened to the dropdown list with the onchange="hentPosition(this.value)" function, because i need to display the other information in another place in the form. If i use the same span tag id, i would get "double infomation", in both tags right?

Does it wotk to put two functions after each other??

<select name="hovedside_id" onchange="hentPosition(this.value), updateUrl(this.value)">

And then open another ajax reguest and get the info i need from the DB, using the 2nd function, and different files to get it with??

Hope someone have an advise on how i can achieve this :-)

If I havent explained very well, ill be happy to try once again!


Edited by klemme: n/a

5 Years
Discussion Span
Last Post by klemme

BY THE WAY - wrong forum - you need JS

If you want this:

onchange="hentPosition(this.value), updateUrl(this.value)"

do this:

onchange="hentPosition(this.value); updateUrl(this.value)"

However, we try to avoid using inline code like this - it's usually tidier to place event handlers to run functions (in script tags in head or external files).

Edited by diafol: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.