batstanggt Posted August 3, 2011 Share Posted August 3, 2011 Im looking to collect a birthdate from a registration form and send it to my mysql database. Whats the most simplistic way to achieve this? -SB Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/ Share on other sites More sharing options...
cssfreakie Posted August 3, 2011 Share Posted August 3, 2011 The most simplistic from my perspective is something that is the most simplistic for the end user. jquery ui offers a date picker that is just that. Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/#findComment-1251271 Share on other sites More sharing options...
iStriide Posted August 7, 2011 Share Posted August 7, 2011 Text boxes are probably the easiest way to do it. <html> <form action='post.php' method='post'> Birth Date: <input type='text' name='day' maxlength='2' style='width: 25px;'/>-<input type='text' name='month' maxlength='2' style='width: 25px;'/> -<input type='text' name='year' maxlength='4' size='1'/> </form> </html> Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/#findComment-1253870 Share on other sites More sharing options...
cyberRobot Posted August 8, 2011 Share Posted August 8, 2011 Text boxes are probably the easiest way to do it. <html> <form action='post.php' method='post'> Birth Date: <input type='text' name='day' maxlength='2' style='width: 25px;'/>-<input type='text' name='month' maxlength='2' style='width: 25px;'/> -<input type='text' name='year' maxlength='4' size='1'/> </form> </html> Of course you'll want to add some kind of label to indicate where to enter the day/month/year. Some format their dates as DD-MM-YYYY, while others may use MM-DD-YYYY. Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/#findComment-1254211 Share on other sites More sharing options...
JasonLewis Posted August 8, 2011 Share Posted August 8, 2011 Why do you not want to use a dropdown? I prefer dropdowns, it's easy to generate an array of days, months and years with PHP and loop over them to create the dropdowns. You can even add in some JavaScript to alter the number of days on specific months if you want to get technical, otherwise do the validation server side when they submit. The easiest way for the coder though would be input boxes, although validation will still be required. Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/#findComment-1254367 Share on other sites More sharing options...
TheFilmGod Posted August 11, 2011 Share Posted August 11, 2011 The most simplistic from my perspective is something that is the most simplistic for the end user. jquery ui offers a date picker that is just that. Agreed. HOWEVER, this would not be so "simple" to implement and would require additional validation since javascript might be disabled. Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/#findComment-1256081 Share on other sites More sharing options...
cssfreakie Posted August 11, 2011 Share Posted August 11, 2011 The most simplistic from my perspective is something that is the most simplistic for the end user. jquery ui offers a date picker that is just that. Agreed. HOWEVER, this would not be so "simple" to implement and would require additional validation since javascript might be disabled. that is indeed the perspective from the coder, not the end user. implementing the jquery ui is probably easier to implement than baking a good cake. besides that <noscript> is exactly for the 0.5 % of the people that have it disabled. anyway i think the Topic starter ran away Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/#findComment-1256117 Share on other sites More sharing options...
cyberRobot Posted August 12, 2011 Share Posted August 12, 2011 anyway i think the Topic starter ran away All the more reason for the rest of us to argue the nitty-gritty details. @TheFilmGod - no matter which option is chosen, it's still a good idea to validate the input...even with drop downs. Someone could bypass the drop-downs, turn off JavaScript, etc. in an attempt to inject bad stuff. Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/#findComment-1256163 Share on other sites More sharing options...
TheFilmGod Posted August 12, 2011 Share Posted August 12, 2011 Cyberrobot - YES, server side validation is a must! Even the actual values in the dropdowns can be spoofed/edited therefore do not ever trust the values specfically provided. Who would have thought that? Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/#findComment-1256213 Share on other sites More sharing options...
cyberRobot Posted August 12, 2011 Share Posted August 12, 2011 Cyberrobot - YES, server side validation is a must! Even the actual values in the dropdowns can be spoofed/edited therefore do not ever trust the values specfically provided. Who would have thought that? The comment was based on the following: ...would require additional validation... Quote Link to comment https://forums.phpfreaks.com/topic/243668-whats-my-alternative-to-using-a-dropdown-menu/#findComment-1256348 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.