1 Reply Latest reply on Jan 20, 2009 3:46 PM by Newsgroup_User

    Dropdown firing event question

    Rudei Level 1
      Hi,

      I have the following code:

      <table width="100%" border="0">
      <tr>
      <td width="45%"><form method="POST" action="maindb.php">
      <div align="left">
      <label for="searchBox"><span class='BoldItemText'>Link </span></label>
      <select name="select1" size="1" onchange='this.form.submit();'>
      <option value="#"><b>Please Select...</b></option>
      <option value="a13" id="test">Alfa</option>
      <option value="#"><b>================</b></option>
      </select></div>
      </form></td>

      But how can I stop the code from firing when I select

      ================

      ?

      At the moment, it fires to maindb.php and gives an error as 'test' is not set. I suppose i can test the value of 'test' in maindb.php but was wondering if this can be done on this page?

      Thanks.
        • 1. Re: Dropdown firing event question
          Level 7
          > But how can I stop the code from firing when I select
          >
          > ================

          Don't do what you have done.

          Consider doing it this way -

          <select name="select1" size="1" onchange='this.form.submit();'>
          <option selected="selected">Please Select...</option>
          <option value="a13" id="test">Alfa</option>
          <optgroup label="================">
          <option>Ferrari</option>
          <option>Lamborghini</option>
          </optgroup>
          </select>


          --
          Murray --- ICQ 71997575
          Adobe Community Expert
          (If you *MUST* email me, don't LAUGH when you do so!)
          ==================
          http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
          http://www.dwfaq.com - DW FAQs, Tutorials & Resources
          ==================


          "Rudei" <webforumsuser@macromedia.com> wrote in message
          news:gl5a92$7k4$1@forums.macromedia.com...
          > Hi,
          >
          > I have the following code:
          >
          > <table width="100%" border="0">
          > <tr>
          > <td width="45%"><form method="POST" action="maindb.php">
          > <div align="left">
          > <label for="searchBox"><span class='BoldItemText'>Link
          > </span></label>
          > <select name="select1" size="1" onchange='this.form.submit();'>
          > <option value="#"> Please Select...</option>
          > <option value="a13" id="test">Alfa</option>
          > <option value="#"> ================</option>
          > </select></div>
          > </form></td>
          >
          > But how can I stop the code from firing when I select
          >
          > ================
          >
          > ?
          >
          > At the moment, it fires to maindb.php and gives an error as 'test' is not
          > set.
          > I suppose i can test the value of 'test' in maindb.php but was wondering
          > if
          > this can be done on this page?
          >
          > Thanks.
          >