Link to home
Start Free TrialLog in
Avatar of jasgot
jasgot

asked on

Select OnChange does not work or fire.

I'm now bald, thank you very much!

Why does this work:
                  "<SELECT size=1 name=\"Item_1_Size\" onChange=\"This.Form.Submit()\">
         <OPTION value=14x22 selected>14\" x 22\"</OPTION>
         <OPTION value=11x28>11\" x 28\"</OPTION>
         <OPTION value=22x28>22\" x 28\"</OPTION>
         <OPTION value=0 >Item Size</OPTION></SELECT>";

But not this:

<SCRIPT TYPE=\"text/javascript\">
<!--
function Update()
{
      alert(\"no fewer than 50!\")
      document.Form1.action = \"/cgi-bin/order.cgi\";           // Does not fire even with this line remarked out
      document.Form1.submit();                  // Does not fire even with this line remarked out
      return true;
}
// -->
</SCRIPT>



                  "<SELECT size=1 name=\"Item_1_Size\" onChange=\"Update()\">
         <OPTION value=14x22 selected>14\" x 22\"</OPTION>
         <OPTION value=11x28>11\" x 28\"</OPTION>
         <OPTION value=22x28>22\" x 28\"</OPTION>
         <OPTION value=0 >Item Size</OPTION></SELECT>";


I need to submit this back to the orgination cgi for error checking and price calculations.

ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, and this surely does not work:
  "<SELECT size=1 name=\"Item_1_Size\" onChange=\"This.Form.Submit()\">

Perhaps this is what you wanted to post:
  "<SELECT size=1 name=\"Item_1_Size\" onChange=\"this.form.submit()\">

Avatar of prsupriya
prsupriya

Hello...

The function you are saying doesn't work functions fine in IE and firefox. Make sure that you have <SELECT is in the form named "Form1".

S:

the function update returns true after submitting !

but the calling statement doen't have any return
like return update();
?
No comment has been added to this question in more than 21 days, so it is now classified as abandoned..
I will leave the following recommendation for this question in the Cleanup topic area:

http:Q_21401851.html --> Accept Zvonko
Any objections should be posted here in the next 4 days. After that time, the question will be closed.

~Aqua
EE Cleanup Volunteer