Jump to content

Recommended Posts

Hi, i have a List/Menu object on my php form. What is does at the minute is the user selects the room that they want to view, then they have to clock go. I need this to happen automatically, can this be done?

 

My Current code       

<form name="roomform" method="post" action="bookingindex.php?week=<? print $mondaythisinstance ?>">

          <select name="selectroom" class="formnames">

              <option value=" <?PHP print $room ?>" selected>Selected: <?PHP print $room ?></option>

<option value="">- - - - - - - - - - -</option>

  <? while ($loop < $getroomcount)

            {

print"<option value=\"".mysql_result($getroomresults,$loop,"roomname")."\">".mysql_result($getroomresults,$loop,"roomname")."</option>";

            $loop ++;

}

?>

          </select>

          <input name="Submit" type="submit" class="formnames" value="Go">

          </div>

      </form>

 

Then once go is clicked it  shows the timetable for the room

Hope you can help

Stuart

Link to comment
https://forums.phpfreaks.com/topic/154475-dropdown-box/
Share on other sites

Do you mean when they select the room, you want the data to display instantly? Or to just submit the form without having to press submit?

 

Solution to the latter is to just add:

 

onchange="document.form_name.submit();"

 

... to your select element.

 

Adam!

Link to comment
https://forums.phpfreaks.com/topic/154475-dropdown-box/#findComment-812225
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.