I need help with dynamic forms and php

Discussion in 'PHP' started by jarjar the novice, Aug 25, 2007.

  1. #1
    Can anyone help?:mad:

    I developed a littl code using php html and java to try and provide a dynamic drop down list on the page

    my java fuctions are as :
    <SCRIPT language=JavaScript>
    function reload(form)
    {
    var val=form.season.options[form.season.options.selectedIndex].value;
    self.location="team.php?season="+val ;
    }
    function reload2(form)
    {

    var val=form.team.options[form.team.options.selectedIndex].value;
    var mylocate ="team.php?team="+val;
    self.location= mylocate ;
    }
    </script>


    the PHP?HTML

    // ##### Select Team #####
    <p class=\"main\" align = center>select a Team
    <?php
    echo "<select name = \"team\" onChange=\"reload2(this.form)\">";

    if ($getteam == "All") {
    ECHO "<option selected value = \"All\">All</option>";
    }
    else
    {
    ECHO "<option >All</option>";
    }
    foreach ($teamarray as $teamout) {
    if ($getteam == $teamout) {
    ECHO "<option selected value = \"$teamout\">$teamout</option>";
    }
    else
    {
    echo "<option> $teamout</option>";
    }
    }
    echo "</select>";
    ?>
    </p>

    this works with fine under fire fox using
    @$cseason =$HTTP_GET_VARS['season'];
    @$cteam = $HTTP_GET_VARS['team'];


    to return the variables for refreshin my sql read. unfortunately under internet explorer it doesn't return the value therfore my script doesnt work.
     
    jarjar the novice, Aug 25, 2007 IP