Results 1 to 3 of 3

Thread: How?

  1. #1
    je Guest

    Default How?

    hello, i have a problem...<BR>i have a form, from wich users can choose two months(ex:Jan-00)and Feb-00), now i want to validate this dates, to see if the begin date is smaler than the termination date.<BR><BR>now i have a function in VBScript that does that<BR><BR>now this is the &#060;form&#062;<BR>&#060;FORM ACTION="pagamentos adicionais1.asp" METHOD="POST" NAME="combo1" onSubmit="verifica()" target="principal" &#062; <BR><BR>the procedure is verifica, but i want to call that page (pagamentos adicionais1.asp) ONLY if the validation is ok<BR>but when i submit the form, i ALWAYS go to the other page, how can i stop it if the validation is not true?<BR><BR>tkhs in advance<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: How?

    You can use a regular button rather than a submit button (may still work). In the regular button place an onClick that references a funtion that uses an If statement to validate the data. If condition is true do one thing, if not, do something else. You can then place your document.formname.submit() in the appropriate part of the if statment.

  3. #3
    Join Date
    Dec 1969

    Default RE: How?

    Change your line to match this:<BR><BR>&#060;FORM ACTION="pagamentos adicionais1.asp" METHOD="POST" NAME="combo1" onSubmit="return verifica();" target="principal" &#062; <BR><BR>then in the function verifica() add the lines<BR>return true;<BR>or<BR>return false;<BR><BR>where return true; is run when the verification is OK.<BR><BR>Boa sorte<BR><BR>Gaby<BR>

Posting Permissions

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