The moose likes HTML, CSS and JavaScript and the fly likes onchange function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "onchange function " Watch "onchange function " New topic

onchange function

Awais Bajwa
Ranch Hand

Joined: Jan 16, 2001
Posts: 191
Hi folks, I have the following function on the onchange event of the html:select
I am calling like this.

<select name="value(registraionTypeId)" onchange="showHide"

and the function is

and the problem is on selecting cancel it changes the value of the list to the newly selected value.

Any Javascript guru can answer this?

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Well I do not see how that code would be running in the first place. You are missing a few ().

If you want to reset the value back to what it was before than you are going to have to change it back with code, return is not going to do anything.

I agree. Here's the link:
subject: onchange function
It's not a secret anymore!