How can vbscript retrieve the "value" of selected html radio butto

S

Schuey

Hi all,

I am currently writing an application involving html and vbscript. I am
building a simple html page for data acquisition, and utilize vbscript to
retrieve the data for further calculation (This html page is not posted on
web and only used on another software program). When I am dealing with html
radio button, I couldn't find a way to retrieve the "value" property of the
selected button during run time. Below are code that I use.

*****vbscript code*******
Sub OnOk() '// When click OK button, I try to retrieve "value" of selected
radio button

Dim sResult

sResult = rButtonGroup1.value '//At run time, error rappears at this line

window.returnValue = sResult

window.close

End Sub


********html code, 2 radio button*******

<input type="radio" value="V1" name="rButtonGroup1">
<input type="radio" value="V2" name="rButtonGroup1">

When I issue the OK button, error message "object does not support this
method or property" 'rButtonGroup1.value' appears. While I expect
"rButtonGroup.value" should return either value V1 or V2. Can anyone give me
some advice about this?

Thanks for your kind attention

Schuey
 
K

Kevin Spencer

I am currently writing an application involving html and vbscript.

(This is going to sting a little, as the doctor says)

I'm afraid you're putting the cart before the horse here. In order to write
a program, one must first learn programming. There is a reason that
programmers get paid as much as they do. They have to study for a good long
time before they can be paid to do it. And in fact, as long as I've been a
programmer (over 10 years now), I have never had the pleasure of being able
to stop studying.

What you've posted indicates a near-total lack of knowledge about
programming, and HTML. I can't even tell what you're TRYING to do from your
description and code, much less begin to tell you what is wrong with it. I
can tell you this much: Programming is an EXACT science. One jot or tittle
wrong will blow up an entire application. I am not exaggerating. The reason
is that "computer" is a fancy name for "calculator." Inside a computer,
everything is converted to numbers, and math is performed to yield the
results. Imagine an algebra problem where you put a single wrong number into
an equation. What do you get out of it? A wrong answer. Now imagine a
ploynomial equation that spans hundreds of lines, with just a single number
wrong in it. What do you get out of it? A wrong answer. Now imagine a
polynomial equation that spans hundreds of lines with a dozen wrong numbers
in it. How do you find them? You certainly can't change any one and expect
to see anything look any better. Each error causes the end result to be
wrong. Fixing any one doesn't make it any righter.

That's why programmers start learing by writing a "hello world" program that
only outputs "hello world" and doesn't take any input from the user. You
start small and work your way up. That is my advice to you.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
K

Kevin Spencer

BTW, Schuey,

I realize that you may be up against a pressing problem, and don't want to
leave you hanging high and dry. If you can post the requirements for your
app, and the entire HTML for the page, I think I can get you over this hump.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top