|
-
May 11th, 2001, 05:59 AM
#1
Thread Starter
Lively Member
vbscript or javascript
Can these be done in vbscript or do I have to use javascript
1) How do I create a button, so that when pressed it calls a function.The function I want to write would be to save the data, or go back to the previous screen. How would I do that??
2) Can I do validation on a text box to see if the user is entering numeric data??
Thanks
Reggie
-
May 11th, 2001, 06:05 AM
#2
Black Cat
VBscript will work only on IE, while javascript will work on IE and other browsers. (Provided the user has them enabled). You would use the onClick event to run a function when a button is pressed. You would have no problem doing data validation in either language.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
May 11th, 2001, 07:24 AM
#3
Thread Starter
Lively Member
JoshT,
I wrote this code for the button, but for some reason it would not go into the function Update_Records().
<INPUT name="Update_Records" onclick="Update_Records()" type="Button" value="Update Data">
Function Update_Records_Onclick()
Response.write "Message"
End Function
-
May 11th, 2001, 10:44 AM
#4
Black Cat
You're mixing client and server side code. Do you want to execute your function on the server on on the client?
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
May 11th, 2001, 12:53 PM
#5
Thread Starter
Lively Member
Which Script runs faster?.
What is the syntax for client side. How do I call a function from the client side??
-
May 11th, 2001, 02:53 PM
#6
Good Ol' Platypus
<INPUT name="Update_Records" onclick="Update_The_Records()" type="Button" value="Update Data">
Function Update_The_Records()
Response.write "Message"
End Function
The first didnt work cuz' you called Update_Records. You couldve called Update_Records_Onclick or put nothing at all for it to work.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
May 11th, 2001, 03:50 PM
#7
Frenzied Member
You won't be able to update a database from client side script. I would suggest changing your button to a submit and onsubmit, call your validation function, before the submit.
You can have the form submit to the same page and put code in the beginning of the page that only runs if the form was submitted You could check the value of say Request.Form("MySubmit"). If it has a value, run the update database code.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
May 11th, 2001, 04:29 PM
#8
Lively Member
to JoshT
JoshT,
It seems like you're always catching people mixing up client/server scripting. Haha, not bad!
-
May 14th, 2001, 11:10 AM
#9
Black Cat
It seems like you're always catching people mixing up client/server scripting. Haha, not bad!
Yeah, it happens a lot. In real life, I've had fun trying to explain to certain people that you can dynamically generate client scripts with server scripts...
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|