alert function

Results 1 to 4 of 4

Thread: alert function

  1. #1
    amber Guest

    Default alert function

    I need to check and make sure that the user enters a start date that is before their end date. I was going to use javascript but cannot get the syntax correct. if anyone knows it please help. the user is entering in both dates and will probably always enter it correctly but i still need to check.

  2. #2
    E! Guest

    Default RE: alert function

    This is dependant upon a proper date format...<BR><BR> // check to see if date is less than start date<BR> if(form1.FieldStopDate.value &#060; form1.FieldStartDate.value)<BR> {<BR> form1.submt.focus()<BR> form1.FieldStopDate.focus()<BR> alert("The Stop Date must be later than the Start Date. Please enter a new Stop Date.")<BR> return false<BR> }<BR> }

  3. #3
    amber Guest

    Default RE: alert function

    thank you soooo much!!!<BR>

  4. #4
    Mauricio C. Guest

    Default RE: alert function

    Do it w/ JScript, that way you can check the values when the user submits.<BR><BR>If you&#039re using a couple of drop menus for date input and they&#039re named like this:<BR><BR>dayS, monthS, yearS (S = Start)<BR>dayE, monthE, yearE (E = End)<BR><BR>then on the JavaScript:<BR><BR>function DataValidation(formName){<BR>if ((formName.dayS.options[formName.dayS.selectedIndex].value &#062; formName.dayE.options[formName.dayE.selectedIndex].value) && (formName.monthS.options[formName.monthS.selectedIndex].value &#062; formName.monthE.options[formName.monthE.selectedIndex].value) && (formName.yearS.options[formName.yearS.selectedIndex].value &#062; formName.yearE.options[formName.yearE.selectedIndex].value)){<BR> alert("Start date must be before end date");<BR> return false;<BR>}//end if<BR>return true;<BR>}//end function

Posting Permissions

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