RSS Forums RSS
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 3725 | Replies: 4 | Thread Tools  Display Modes
Reply
Join Date: Mar 2006
Posts: 20
Reputation: SeekAnswers is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
SeekAnswers SeekAnswers is offline Offline
Newbie Poster

VBScript: Focusing on a form control

  #1  
Jun 11th, 2006
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>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2005
Location: Dallas, TX
Posts: 482
Reputation: campkev is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: VBScript: Focusing on a form control

  #2  
Jun 12th, 2006
it might be possible, but javascript is really the best way to handle it
Reply With Quote  
Join Date: Jul 2004
Location: Sydney, Australia
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: VBScript: Focusing on a form control

  #3  
Jun 12th, 2006
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 ::

Reply With Quote  
Join Date: Jul 2005
Location: Dallas, TX
Posts: 482
Reputation: campkev is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 19
campkev campkev is offline Offline
Posting Pro in Training

Re: VBScript: Focusing on a form control

  #4  
Jun 12th, 2006
Originally Posted by Lafinboy
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
Reply With Quote  
Join Date: Mar 2006
Posts: 20
Reputation: SeekAnswers is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
SeekAnswers SeekAnswers is offline Offline
Newbie Poster

Re: VBScript: Focusing on a form control

  #5  
Jun 12th, 2006
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the ASP Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 6:36 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC