treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Form action not working in Chrome HELP.

  • Dear forums,

    i have a drop down form that looks like this:


    <FORM
    ACTION="../cgi-bin/redirect.pl"
    METHOD=POST onSubmit="return dropdown(this.gourl)" onclick="return dropdown(this.gourl)">
    <SELECT NAME="gourl" style="width:250px;">
    <OPTION VALUE="">- Highlighted Projects -</OPTION>

    <OPTION VALUE="index.html">Overview</OPTION>
    <OPTION VALUE="stoddert.html">Stoddert Elementary</OPTION>
    <OPTION VALUE="eastern.html">Eastern High School</OPTION>


    </SELECT>

    <INPUT TYPE="SUBMIT" VALUE="Go">
    </FORM>


    :::::::::::::::::::::the script:>>>>>>>

    <SCRIPT TYPE="text/javascript">
    <!--
    function dropdown(mySel)
    {
    var myWin, myVal;
    myVal = mySel.options[mySel.selectedIndex].value;
    if(myVal)
    {
    if(mySel.form.target)myWin = parent[mySel.form.target];
    else myWin = window;
    if (! myWin) return true;
    myWin.location = myVal;
    }
    return false;
    }
    //-->
    </SCRIPT>


    -----------//----------

    clicking the 'GO' button works fine. But if you notice i also have the "onclick" set to return the url.

    Why wont this work in chrome?

    Someone Please help, Thanks

    -Jaime
  • Are you supposed to be able to attach an onclick event handler to an entire form? Is this something that triggers when you click on any part of the form?