Go Back   CodingForums.com > :: Computing & Sciences > Computer Programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-08-2004, 05:02 PM   PM User | #1
velious
Regular Coder

 
Join Date: Jun 2003
Location: California
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
velious is an unknown quantity at this point
Angry vbscript and html forms..pain in the @$$

I have a few questions here:

1) in the form, does the name of the button have to have the ()'s or only when its in the vb script?

2) do i need the <form> tags? with the <input> tags can i just get rid of them and use the input tags instead?

3) and i dont understand how to make the vb code look at the html values that the user inputs and this is making me real frustrated, so if anyone can please help me, that would be great.



<html>
<!-- user inputs a value,and the box returns the same value that the user inputs -->

<head>

<script language="vbs">

sub bvalue_onclick()


end sub

</script>



</head>

<body bgcolor="fafad2">

<!-- form -->
<form name="value">
Input any value: <input type="text" name="ivalue">
<input type="button" name="bvalue" value="click me">
</form>

<!-- end of form -->

</body>
</html>
velious is offline   Reply With Quote
Old 03-09-2004, 12:38 AM   PM User | #2
sad69
Senior Coder

 
Join Date: Feb 2004
Posts: 1,206
Thanks: 0
Thanked 0 Times in 0 Posts
sad69 is an unknown quantity at this point
Personally, I would use Javascript over VBScript because it makes more sense, and browsers other than Internet Explorer support it. (VBScript is a Microsoft product, thus only Internet Explorer supports it).

But if you really want to know how to make your code work:
Code:
<html> 
<!-- user inputs a value,and the box returns the same value that the user inputs -->

<head>

<script language="vbs">

sub bvalue_onclick()
 msgbox theForm.theInput.value
end sub

</script>



</head>

<body bgcolor="fafad2">

<!-- form -->
<form name="theForm">
Input any value: <input type="text" name="theInput">
<input type="button" name="bvalue" value="click me">
</form>

<!-- end of form -->

</body>
</html>
For more form stuff with VBScript, check out:
http://authors.aspalliance.com/glenncook/vbscript.asp

If you'd like to learn a little Javascript, check out:
http://javascript.about.com/library/...rmvalidate.htm

You do need the <form> tag if you want to be able to submit the inputs on your form somewhere, such as to an ASP, PHP, JSP, Servlet, CGI, or something else to do some logic stuff, or even to send the inputs to an email address.

If you're not going to do anything with your inputs outside of this page, then no, you don't need the form tags. But it still doesn't hurt to have them in.

Hope that clears some stuff up. Post back if you're having more troubles,
Sadiq.
sad69 is offline   Reply With Quote
Old 03-09-2004, 04:49 PM   PM User | #3
velious
Regular Coder

 
Join Date: Jun 2003
Location: California
Posts: 231
Thanks: 0
Thanked 0 Times in 0 Posts
velious is an unknown quantity at this point
Thanks, I'll be sure to ask if i have any more questions.
velious is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:29 PM.


Advertisement
Log in to turn off these ads.