SitePoint Sponsor |
|
User Tag List
Results 1 to 5 of 5
Thread: execute 2 scripts after onchange
-
Jun 11, 2007, 02:51 #1
- Join Date
- Jun 2004
- Posts
- 417
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
execute 2 scripts after onchange
Hi all,
can anyone tell me how to execute two difierent scripts when I have an OnCHange in my form field? I have sth like this, but it doesn't quite work:
Code:<select name='brand' onchange="reload(this.form); validateBrand(this, 'brand', false);"><option value=''>Choose brand</option>";
M
-
Jun 11, 2007, 04:40 #2
- Join Date
- Nov 2005
- Location
- The Netherlands
- Posts
- 808
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It should work like that.
Does Firebug or the Firefox Error Console give you anything?
Edit: Hm, I see now that you're probably using the 'this' keyword incorrectly. 'this' refers to the changed SELECT element, so it's not very likely to contain a form object.
-
Jun 11, 2007, 06:06 #3
- Join Date
- Mar 2005
- Location
- USA
- Posts
- 5,482
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ize, this.form works. Form controls have a property that is a reference to the form they are in.
webnology, you're going to need to show us more code.
It's best to avoid using inline event handlers. I suggest you read up on Unobtrusive JavaScript and other JavaScript Best Practices.We miss you, Dan Schulz.
Learn CSS. | X/HTML Validator | CSS validator
Dynamic Site Solutions
Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.
-
Jun 11, 2007, 08:16 #4
-
Jun 12, 2007, 01:00 #5
- Join Date
- Jun 2004
- Posts
- 417
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thx for the answers, but I was able to use the page without the second validation script. We'll do it differently. Thx for the links too.
M
Bookmarks