Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Button to validate input
Old
  (#1)
Basr
Guest
 
Posts: n/a
Default Button to validate input - 06-04-2007, 09:31 AM

I tried to use this script to validate the input of the form Ford.

When I use the Input ype Button the script is OK

I want to use a picture as a button but then the script does not function.
Can someone help me a little.

Thanks in advance
Marcel

<INPUT TYPE="image" SRC="transport.gif" NAME="Trans" BORDER="0">







<SCRIPT LANGUAGE=VBScript>

Sub Trans_OnClick()

'Validate all fields contain data

If Len(Ford.Nam.value)=0 THEN

Alert "You need to fill out your Name !"

Ford.Nam.focus

Exit Sub





Elseif Len(Ford.Carnr.value)=0 THEN

Alert "You need to fill out your Carnumber!"

Ford.Carnr.focus

Exit Sub



End If

Call Trans.submit()

End Sub

</SCRIPT>


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Button to validate input
Old
  (#2)
Basr
Guest
 
Posts: n/a
Default Re: Button to validate input - 06-04-2007, 09:31 AM

Do not respond, I found a solution!

"Basr" <EMAIL REMOVED> schreef in bericht
news:451e5c85$0$2023$EMAIL REMOVED. ..
> I tried to use this script to validate the input of the form Ford.
>
> When I use the Input ype Button the script is OK
>
> I want to use a picture as a button but then the script does not function.
> Can someone help me a little.
>
> Thanks in advance
> Marcel
>
> <INPUT TYPE="image" SRC="transport.gif" NAME="Trans" BORDER="0">
>
>
>
>
>
>
>
> <SCRIPT LANGUAGE=VBScript>
>
> Sub Trans_OnClick()
>
> 'Validate all fields contain data
>
> If Len(Ford.Nam.value)=0 THEN
>
> Alert "You need to fill out your Name !"
>
> Ford.Nam.focus
>
> Exit Sub
>
>
>
>
>
> Elseif Len(Ford.Carnr.value)=0 THEN
>
> Alert "You need to fill out your Carnumber!"
>
> Ford.Carnr.focus
>
> Exit Sub
>
>
>
> End If
>
> Call Trans.submit()
>
> End Sub
>
> </SCRIPT>
>
>



   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Button to validate input
Old
  (#3)
Dean Earley
Guest
 
Posts: n/a
Default Re: Button to validate input - 06-04-2007, 09:31 AM

Basr wrote:
> Do not respond, I found a solution!


You found a relevant news group?
VBScript/ASP is VERY different to Visual Basic.

--
Dean Earley (EMAIL REMOVED)
i-Catcher Development Team

iCode Systems
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top