A 6 textbox headache

Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: A 6 textbox headache

  1. #1
    aspin Guest

    Default A 6 textbox headache

    I have 6 text boxes one below the other.<BR>A user enter Dates in those text boxes.<BR>He may enter the dates in any number of textboxes of those 6, and in any order.ie. He may leave the first text box blank, enter it in the second text box, leave the third blank etc etc. - any number of text boxes.<BR>The problem is when he enter submit i used post method to transfer all the dates to the next page....<BR>HERE I WANT TO CHECK THAT ALL THE ENTERED DATES ARE OF THE SAME YEAR....How would I arrive at this solution in the best possible way?????<BR>The major problem is checking which textboxes are filled, which are not and HERE lies so many possibilities I get entangled in it.<BR><BR>Somebody please help !!!!!!!!!!!!!!

  2. #2
    New ASP Guest

    Default RE: A 6 textbox headache

    you can use javascript to do it.<BR>Please check: <BR>http://developer.irt.org/script/form.htm#5<BR><BR>or you can check them in your next page:<BR><BR><BR>IF NOT isdate(request.from("your_date_1")) THEN<BR>.... redirect to pre_page<BR>END IF<BR>:<BR>:<BR>IF NOT isdate(request.from("your_date_2")) THEN<BR>.... redirect to pre_page<BR>END IF<BR>:<BR><BR>:<BR><BR>HTH

  3. #3
    Join Date
    Dec 1969

    Default Just to shorten that up a little

    for fieldNum = 0 to 6<BR> IF NOT isdate(request.from("your_date_" & fieldNum & "")) THEN<BR> redirect to pre_page<BR> END IF<BR>next

  4. #4
    aspin Guest

    Default Mistake in Explaining

    I guess I made a mistake in explaining<BR>I want to ensure that the year in any of the entered boxes is the Same.<BR>User should not be able to enter 2000 in text box 1 and then 2001 in text box 3.<BR><BR>Keeping also in mind that a lot of text boxes may be empty.

  5. #5
    New ASP Guest

    Default Note:

    Please test this:<BR><BR>DIM str_test<BR>&#060;-- test 1 don&#039t assign any value for it<BR>str_test = NULL &#060;-- test 2 assign null to it<BR>str_test = "" &#060;-- test 3 assign "" to it<BR><BR>response.write isdate(str_test) &#060;-- look what happened !!<BR><BR>if all return *FALSE* then you got it.<BR>else you have to check ISNULL(), = "" , .....<BR><BR>Good luck!!

  6. #6
    New ASP Guest

    Default RE: Mistake in Explaining

    IF DateDiff("yyyy", request.form("yourdate1"), request.form("yourdate2")) = 0 THEN<BR> year is same<BR>.... your code<BR>ELSE<BR> year is NOT the same<BR>.... your code<BR>END IF<BR><BR>NOTE: you have to make sure:<BR><BR>request.form("yourdate1") <BR>request.form("yourdate2") <BR>:<BR>request.form("yourdate6") <BR><BR>are all date first!!!

  7. #7
    aspin Guest

    Default RE: Note: HELP !!!!!!!!!!!!!!!!!!!!!!!!

    Thanks for the response.I already have the null/empty check and isDate Check working . Here is what I need.<BR><BR>Textbox1 = Null<BR>Textbox2= 12/12/2000<BR>Textbox3= 01/3/2001<BR>Textbox4 = Null<BR>TextBox5 = 12/2/2000<BR>TextBox6= 12/30/2000<BR><BR>HOW DO I ENSURE THAT ALL DATES BELONG TO THE SAME YEAR.<BR>I dont want the user to enter dates belonging to two different years.<BR><BR>

  8. #8
    ASPIN Guest

    Default Next SOLUTION BUT PROBLEM DOES NOT END !!!!!!!!!!!

    That&#039s a neat solution.<BR>But what if Request.Form(date2) is Null??????<BR>The user may leave any textbox empty and fill any textbox<BR>He may leave TextBox1 empty, fill TextBox2 leave textbox3 Empty, fill textBox4.....<BR>THAT IS WHERE I AM FACING A PROBLEM.<BR><BR>Ofcourse all the Date Checks are in Place.

  9. #9
    New ASP Guest

    Default RE: Note: HELP !!!!!!!!!!!!!!!!!!!!!!!!

    Use DateDiff Function<BR>See my above post please.

  10. #10
    Join Date
    Dec 1969
    Los Angeles, CA

    Default You want this in Client OR Server side

    please tell us that and then we couls help<BR><BR>If you have already mentioned sorry i have not read all the posts please reply telling me where you wnat to validate it

Posting Permissions

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