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>

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.

Also, bear in mind that VBScript is only processed by Internet Explorer. No other browser uses VBScript for client side processing.

Hence my comment that javascript is the way to go

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?

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.

This article has been dead for over six months. Start a new discussion instead.