Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Validating PHP dropdown menu
Index -> Programming, PHP -> PHP Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Natsu




PostPosted: Tue Feb 26, 2013 7:54 pm   Post subject: Validating PHP dropdown menu

Im trying to make it so that each course can only be selected once, so let's say I select math for the first course, it should not be in the next dropdown menu. So only 1 of each course can be chosen.

Here is the code: http://pastebin.com/zUaEXbPS
Sponsor
Sponsor
Sponsor
sponsor
Zren




PostPosted: Wed Feb 27, 2013 1:42 am   Post subject: Re: Validating PHP dropdown menu

May the heathen gods smite you for this:

php:

<?php
for ($i=0;$i<101;$i++)
                {
                echo "<option value=\"".$i."\">".$i."</option>";
                }     
?>


What's wrong with a textbox? What are your reasons specifically for using a drop down box for this data field?

The formatting of this code makes my head hurt. Anyways. Selecting a option is a client side event that happens after the server finishes generating the page. This is something that should be done with client side scripting.
iso




PostPosted: Fri May 10, 2013 1:16 am   Post subject: RE:Validating PHP dropdown menu

Javascript is necessary.

Also, you really shouldn't be using tables or inline styling.
Display posts from previous:   
   Index -> Programming, PHP -> PHP Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: