Client Side Scripting Help Needed! - URGENT (again) 
Author Message
 Client Side Scripting Help Needed! - URGENT (again)

I have a login prompt.  I need to use client side scripting (VBScript) to
check if the two text input fields have been filled in or not.  If they are
not filled in, I need it to stay at the same page and tell them via a msgbox
that they need to fill in the fields.  If both fields are filled in, I need
it to continue to the next page.

If anyone can help me, it would be greatly appreciated!

Susan L.



Tue, 04 Jun 2002 03:00:00 GMT  
 Client Side Scripting Help Needed! - URGENT (again)

Let's say your text-field is like this...

<form name="myForm" onsubmit="CheckDataValidity()">
<input type="text" name="myText">
<input type="submit" value="Send">

then you will write this code in the CheckDataValidity sub...

Sub CheckDataValidity()
    If myForm.myText.Value = "" Then
        MsgBox "Enter the value"
    End If
End Sub

onsubmit
----------------------------------------------------------------------------
----

Description

Fires when a form is about to be submitted.

Return Value

Returns TRUE or FALSE.

Remarks

The onsubmit event default action is to submit the form. This event can be
overridden by returning FALSE in the event handler. The purpose of this is
to allow the developer to do validation of the data on the client side and
prevent invalid data from being submitted to the server. This event will not
bubble. Events that do not bubble can only be handled on the individual
object that fired the event.

--

- Manish Jethani.

My personal website-
http://mjweb.hypermart.net/personal/


Quote:
> I have a login prompt.  I need to use client side scripting (VBscript) to
> check if the two text input fields have been filled in or not.  If they
are
> not filled in, I need it to stay at the same page and tell them via a
msgbox
> that they need to fill in the fields.  If both fields are filled in, I
need
> it to continue to the next page.

> If anyone can help me, it would be greatly appreciated!

> Susan L.



Wed, 05 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Client Side Scripting Help Needed! - URGENT

2. Server Side Scripter needs help on Client Side

3. Client Side + Server Side Scripts

4. How do I use server-side var in client-side scripts

5. ASP referring to server side variables in client side script

6. Client side and Server side script working together

7. Urgent : Passing variables from client script to server side

8. Client Side Execution of Scripts - Urgent :)

9. Help, please, on client side scripting

10. Client side scripting / server side scripting

11. Accessing Data generated with client-side script from server-side script

12. Calling Server Side Script from Client Side Script

 

 
Powered by phpBB® Forum Software