Find the answer to your Linux question:
Results 1 to 8 of 8
greetings, i have a php page with a few drop downs and a submit button. The submit button does nothing when clicked in i.e.7, although chrome, firefox, new versions of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2012
    Posts
    29

    php html form i.e. 7


    greetings,
    i have a php page with a few drop downs and a submit button. The submit button does nothing when clicked in i.e.7, although chrome, firefox, new versions of i.e. it works fine. Is there anything i can do to fix this problem?

    this my php:

    PHP Code:
    <?
    if ( isset($_POST["menu"]) and !isset($_POST["menufc"]) and ($_POST["date"]) ){
                
    header("Location: http://" $_POST["menu"] . $_POST["date"] . ".html");
    }elseif(!isset(
    $_POST["menu"]) and isset($_POST["menufc"]) and ($_POST["date"])){
                
    header("Location: http://" $_POST["menufc"] . $_POST["date"] . ".html");
    }else{
            echo 
    "";
    }
    ?>
    this is my form:

    HTML Code:
    <form name="menu" method="post">
    <span style="font-weight:bold">DIR</span>
    <select name="menufic">
    <form name="menufic" method="post">
      <option selected disabled hidden value=''></option>
      <option value="Toronto.">Toronto</option>
      <option value="Toronto.">Toronto</option>
      <option value="Toronto.">Toronto</option>
    </select>
    
    <span style="font-weight:bold">Date</span>
    <form name="date" method="post">
    <select name="date">
      <option value=<?php echo $TODAY ?>><? echo $TODAY ?></option>
      <input type="reset" value="reset" />
    </select>
    </form>
    </body>

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,570
    1. What submit button?
    2. The reset button should not be inside the select
    3. If this is all one form you don't need the second form element. If not then close the first form
    4. This is pedantic but the spans would be better done as labels.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  3. #3
    Just Joined!
    Join Date
    Sep 2012
    Posts
    29
    hi sorry, button is here:

    PHP Code:
    <option value=<?php echo $TODAY ?>><? echo $TODAY ?></option>
    <input type="reset" value="reset" />
    spans being done as labels? please explain?

  4. #4
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,570
    Code:
    <form name="menu" method="post">
        <label for="menufic">DIR</label>
        <select name="menufic">
          <option selected disabled hidden value=''></option>
          <option value="Toronto.">Toronto</option>
          <option value="Toronto.">Toronto</option>
          <option value="Toronto.">Toronto</option>
        </select>
    
        <label for=date">Date</label>
        <select name="date">
          <option value=<?php echo $TODAY ?>><? echo $TODAY ?></option>
        </select>
    
        <input type="reset" value="reset" />
        <input type=submit" value="That's not a submit button. (sound effect=schlinggggg) THIS is a submit button" />
    </form>
    The label element at w3schools.com

    I am still not seeing a submit button, just a reset one which should be outside the select so I have added a subtle one!
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  5. #5
    Just Joined!
    Join Date
    Sep 2012
    Posts
    29
    ok ive tested it out and it doesnt work in ie7. When i click submit nothing happens. Is there something i need to tweak for ie7 ?

  6. #6
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,570
    When you have the form in the browser, what do you see when view the source?

    [edit]
    Does IE7 require the action attribute on the form element?

    Code:
    <form name="menu" method="post" action="WHERE ARE WE GOING">
    [/edit]
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  7. #7
    Linux User
    Join Date
    Dec 2009
    Posts
    264
    @bishop2001

    tweak ... lol
    Your problem ain't the php but the html code.


    <form name="menu" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <span style="font-weight:bold">DIR</span>
    <select name="menufic">
    <form name="menufic" method="post">
    <option selected disabled hidden value=''></option>
    <option value="Toronto.">Toronto</option>
    <option value="Toronto.">Toronto</option>
    <option value="Toronto.">Toronto</option>
    </select>

    <span style="font-weight:bold">Date</span>
    <form name="date" method="post">
    <select name="date">
    <option value=<?php echo $TODAY ?>><? echo $TODAY ?></option>
    <option value="<?php echo $TODAY.'">'.$TODAY; ?></option>
    <input type="reset" value="reset" />
    </select>
    </form>
    </body>


    Please please ... just delete what I marked RED ... and add the green stuff.

    I don't understand that your code even works ...

  8. #8
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,570
    <option value=<?php echo $TODAY ?>><? echo $TODAY ?></option> would be OK if the server is configured for short tags.
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •