Please support our ASP advertiser: Lunarpages ASP Web Hosting
![]() |
•
•
Join Date: Mar 2006
Posts: 20
Reputation:
Rep Power: 3
Solved Threads: 0
Good morning all, I was wondering if VBScript could do the same thing as what the below JavaScript is doing, that is to focus on a form control after the user has made some mistakes in his/her inputs...
<script type="text/javascript">
function Verify_Inputs() {
if(document.Testing_Form.Testing_TextBox.value == "") {
alert("Please enter a value.")
document.Testing_Form.Testing_TextBox.focus();
return false;
} // Ends the If-Clause.
document.Testing_Form.submit();
return true;
} // Ends the "Verify-Inputs" function.
</script>
<script type="text/javascript">
function Verify_Inputs() {
if(document.Testing_Form.Testing_TextBox.value == "") {
alert("Please enter a value.")
document.Testing_Form.Testing_TextBox.focus();
return false;
} // Ends the If-Clause.
document.Testing_Form.submit();
return true;
} // Ends the "Verify-Inputs" function.
</script>
•
•
Join Date: Jul 2004
Location: Sydney, Australia
Posts: 166
Reputation:
Rep Power: 5
Solved Threads: 7
VBScript has identical form focus syntax as JavaScript, so yes, you can set the focus using client side VBScript. Declare your code block as type="text/VBScript" though. Also, bear in mind that VBScript is only processed by Internet Explorer. No other browser uses VBScript for client side processing.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.
Lafinboy Productions
:: Website Design :: Website Development ::
Lafinboy Productions
:: Website Design :: Website Development ::
•
•
Join Date: Mar 2006
Posts: 20
Reputation:
Rep Power: 3
Solved Threads: 0
I'm sorry, but I think that you haven't shown me how to do that, or rather the directions in which how I can do that, could you direct me to the right place for it, thanks?
•
•
•
•
Originally Posted by Lafinboy
VBScript has identical form focus syntax as JavaScript, so yes, you can set the focus using client side VBScript. Declare your code block as type="text/VBScript" though. Also, bear in mind that VBScript is only processed by Internet Explorer. No other browser uses VBScript for client side processing.
![]() |
Similar Threads
Other Threads in the ASP Forum
- Excel Form - For/Next - Naming Convention Problem (Visual Basic 4 / 5 / 6)
- Javascript/VBScript within VB6 application (Visual Basic 4 / 5 / 6)
- Control button Click event (Visual Basic 4 / 5 / 6)
- request.form is not working in asp.net (ASP.NET)
Other Threads in the ASP Forum
- Previous Thread: Pop-Up Calendar for ASP
- Next Thread: Count number of checkboxes being checked in asp.net
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode