473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Button to validate input

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>
Sep 30 '06 #1
2 3603
Do not respond, I found a solution!

"Basr" <mo****@hetnet.nlschreef in bericht
news:45**********************@text.nova.planet.nl. ..
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>


Oct 1 '06 #2
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 (de*********@icode.co.uk)
i-Catcher Development Team

iCode Systems
Oct 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jimbo | last post by:
I am trying to right a script so that the "submit button" only appears when certain criteria has been met. I have tried putting it in an IF statement, without any luck. Maybe a function would allow...
8
by: Syed Ali | last post by:
Hello, I have 1 HTML form with 4 submit buttons and 10 textfield entry areas. If submit button1 is pressed I need to make sure that all 10 textfield entries have been filled before submitting...
2
by: Matt | last post by:
In the following code, I have 2 questions regarding submit button with image. 1) Does this code <input type="image" name="populate" src="populate.gif"> behave the same as an HTML submit button...
4
by: ...D. | last post by:
OK. I am halfway decent with HTML. Now I want to try javascript for some things that HTML cannot do. I have looked over a tutorial & all. What I want to do is create a button, that when...
2
by: Vinita Sharma | last post by:
Hi All, I have a strange problem. I have 2 text boxes and a button in my form. There is a function called on onchange event of the first text box. There is another function called on onclick...
2
by: Humberto Alvarez | last post by:
Hi All I'm using asp requiredfieldvalidator and regularexpressionvalidator to validate a text field and a file input field respectively. The validation messages (the text property of the...
4
by: John Boy | last post by:
Hi, Can anyone help. This is really doing my nut in. 3 years ASP exp. and now doing .DOT which is a step in the wrong direction. Basically I am left with the code of a guy who has left. When I...
7
by: drum118 | last post by:
Trying to make some CSS buttons, but they fall apart in Firefox and IE. The first set of buttons work fine in IE, but in Firefox they double in size when mouseover. The second set is too wide...
5
by: sumeetmakkar | last post by:
Hi all, I am a begineer and working on a project. Facing trouble linking a submit buuton to a page of my choice.Script i am using is: <SCRIPT language=JavaScript><!-- function validate(form) {...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.