• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 529
  • Last Modified:

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.

0
jasgot
Asked:
jasgot
1 Solution
 
ZvonkoSystems architectCommented:
Change the select tag to this:

 "<SELECT size=1 name='Item_1_Size' onChange='Update(this)'>

And the function change to this:

<SCRIPT TYPE='text/javascript'>
<!--
function Update(theSel){
     alert('no fewer than 50!')
     theSel.form.action = '/cgi-bin/order.cgi';  
     theSel.form.submit();  
     return true;
}
// -->
</SCRIPT>

0
 
ZvonkoSystems architectCommented:
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()\">

0
 
prsupriyaCommented:
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:

0
 
str_kaniCommented:
the function update returns true after submitting !

but the calling statement doen't have any return
like return update();
?
0
 
Andrew BeersTechnology LeadCommented:
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
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now