Javascript onChange not working in xhtml |
[eluser]Jason Tan Boon Teck[/eluser]
I am not sure which is the cause of the failure - CI, XHTML, Javascript, etc.? What the form does is to trigger a reload of the page whenever a drop down selection is changed. This will retrieved a different set of selections in the second drop down (cascading menu). I gave removed a third drop down, to reduce complexity of testing. Right now, onChange doesn't seem to work. [removed]() also doesn't seem to display, but alert() does. I have deliberately misspelled some terms to prevent the forum app from stripping away the codes. Can anyone spot my error? Thanks. View file: Code: <?php The
[eluser]Jason Tan Boon Teck[/eluser]
The output as xhtml is as follows: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
[eluser]Arun Kris[/eluser]
If the onchange event is not working in mozila then set an id atribute to the <select> element and try. ![]()
[eluser]geshan[/eluser]
use some jquery (http://jquery.com) or you might again have problem with IE.
[eluser]Jason Tan Boon Teck[/eluser]
[quote author="Arun Kris" date="1257263656"]If the onchange event is not working in mozila then set an id atribute to the <select> element and try. ![]() Could you please elaborate? I'm weak at Javascript and the above js snippets are not mine. Thanks.
[eluser]saidai jagan[/eluser]
<select name='diagnosisChapter' class='normal' oonChange='jaavascript ![]() Change it to <select name='diagnosisChapter' class='normal'>";
[eluser]LuckyFella73[/eluser]
Hi, If you want your XHTML code to be valid you have to write the event handler in lowercase letters. Valid: "onchange" NOT valid: "onChange" I don't know if that could solve your problem but you could try maybe.
[eluser]Arun Kris[/eluser]
simply add the id attribute to the <select element> ![]()
[eluser]Jason Tan Boon Teck[/eluser]
[quote author="LuckyFella73" date="1257269059"]Hi, If you want your XHTML code to be valid you have to write the event handler in lowercase letters. Valid: "onchange" NOT valid: "onChange" I don't know if that could solve your problem but you could try maybe.[/quote] I tried. That didn't help the script. :-( |
Welcome Guest, Not a member yet? Register Sign In |