Results 1 to 3 of 3

Thread: Help formatting textbox input please!

  1. #1
    Join Date
    Jan 2014

    Help formatting textbox input please!

    I am an Intern on a Student Marketing Team. For the marketing team here we have a web form that clients fill out to submit work orders. 99% of clients here are all within the office I work in. I am currently editing the html code for this form and I am wondering if someone can help.

    I currently have a text box in the form where the user can input a date that the project is due. I want to format the textbox three ways:

    1. The text box needs to be restricted to MM/DD/YYYY format
    2. The text box needs to be restricted to ONLY accept dates that are AT LEAST two weeks from the current date.
    3. Input in the text box should be required (not necessary really but I would prefer it.)

    The form is used in Safari or IE most of the time. But I'm not sure what browsers all the clients use.

    I am pretty much a newbie to coding, with only a introduction college course under my belt so all help is GREATLY appreciated!

    Here is the only code I have for the text box as it stands, so you can see where I'm starting:

    <p><input name="Date" size="20" type="text"></p>

    I tried using type="date" for HTML5 but I don't believe this method works because of the browser not recognizing HTML5.

    Thank you again in advance!

  2. #2
    Join Date
    Mar 2012
    If you need compatibility with IE8 or lower, you cannot use HTML 5 date input. The way this is usually resolved is with separate <select>'s for day, month and year. As for the validation you require, that would need to be done in JavaScript or PHP.

  3. #3
    Join Date
    Mar 2011
    I'd encourage you to continue to use 'type="date"'. Browser support is only going to improve as time passes, so at some point all of your users will see a nice date picker. And until then, browsers will simply treat it as 'type="text"', so there's no need to change this setting back.
    Rick Trethewey
    Rainbo Design

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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