Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

text box question

Posted on 1999-06-30
6
Medium Priority
?
176 Views
Last Modified: 2010-04-09
I have two text boxes on a search form.  
The first text box is the FROM date box and the second is the TO box.
My question is how do I hard code the boxes so when the user begins entering information in the boxes they see

__/__/____  (kind of like the input mask in Access97

instead of letting them enter whatever the want.

Thanks,
dmfttm
0
Comment
Question by:dmfttm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 4

Expert Comment

by:siabod
ID: 1851384
<INPUT TYPE="text" NAME="from" VALUE="06/30/1999">
<INPUT TYPE="text" NAME="from" VALUE="07/12/1999">
0
 
LVL 4

Expert Comment

by:siabod
ID: 1851385
sorry, the second NAME="from" should be NAME="to"
0
 

Author Comment

by:dmfttm
ID: 1851386
Sorry siabod,

I guess I need to clarify a little better.
I want the user to be able to enter their own search dates, but I want the input to be formatted like __/__/____.  So when they start typing in a date the format automatically shows up the user doesn't have to type the /.  Kinda of like access.

dmfttm


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
coffeewood earned 80 total points
ID: 1851387
I'm not sure that want you want can be done exactly like you want it; however, you can have three smaller input boxes for for each date (month, day, year), dynamically generate drop down lists in each box, and let the user click in the dates instead of typing them in.  You can hard code the / between each box then use code to concatinate both dates into a format the database (if you using one) will understand.  Here's an example of the drop boxes:

</select>
</td>
<td><select name="Month">
<script language = "JavaScript">
<!--
for (i = 1; i < 13; i++)
      document.write("<option>" + i)
//-->
</script>
</select></td>

<td><select name="Day">
<script language = "JavaScript">
<!--
for (i = 1; i < 32; i++){
      document.write("<option>" + i)}
//-->
</script>
</select></td>

<td><select name="Year">
<Script language = "JavaScript">
<!--
CurDate = new Date();
CurYear = CurDate.getFullYear();
for (i = CurYear - 5; i < CurYear + 5; i++)
      document.write("<option>" + i)
//-->
</script>
</select>
</td>

You will also need a data validation script to make sure the user doesn't select march 31 or something like that.
0
 

Expert Comment

by:coffeewood
ID: 1851388
whoops, I meant February 31 (doooooh)!
0
 

Author Comment

by:dmfttm
ID: 1851389
coffeewood,

Thanks for the answer.  I wasn't sure there was a way without using separate text boxes.  However, your answer provided me with a solution that hadn't crossed my mind.  The drop down list boxes.  Looks and works good.  

Thanks again,
dmfttm
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question