|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Data validation FORMS
If the date field is empty, then display an error message; that bit works. When I click on OK, the form submits, which shouldn’t happen; any ideas?
Code:
<input type="submit" name="btnSubmit" value="Submit">
</form>
<SCRIPT LANGUAGE=vbscript>
Sub btnSubmit_OnClick()
If Len(updateform.updatefrm_date.value) = 0 Then
Alert "You must enter a date"
updateform.updatefrm_date.focus
Exit Sub
End If
Call updateform.submit()
End Sub
</SCRIPT>
|
|
#2
|
||||
|
||||
|
1) This is an ASP question, not a Visual Basic question.
2) The reason the form is submitting is because you have this line of code in the Sub. Code:
Call updateform.submit() |
|
#3
|
|||
|
|||
|
can this be moved to the ASP forum please?
|
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Data validation FORMS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|