Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

working on html objects using HTML DOM, VBscript

654 views
Skip to first unread message

Rama

unread,
Aug 18, 2008, 10:11:01 AM8/18/08
to
Hi All,

I have one html page with forms and objects like radiobuttons,
checkboxes, dropdown list, text boxes, links.....
I will perform some operations on these objects, like selecting value
from dropdown, check the checkbox ON...
When I click on button, the seleted values should display in the
textbox.

can some one please provde me the code for this using HTML DOM,
VBscript.

Thanks in adavance.

- thanks

Tom Lavedas

unread,
Aug 18, 2008, 11:54:52 AM8/18/08
to

Are you looking for a standalone VBS procedure to automate a page's
operation or client-side script to include in the HTML? The first
case requires the use of the InternetExplorer.Application object to
access. The second is just encoded into the HTML page in a <script></
script> block (and widely documented at MS sites). Therefore, knowing
which environment is needed significantly impacts the response.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

Paul Randall

unread,
Aug 18, 2008, 3:22:52 PM8/18/08
to

"Rama" <gopi...@gmail.com> wrote in message
news:453e12cd-29bc-439a...@w39g2000prb.googlegroups.com...

HTAs can contain forms and the objects you mention. Microsoft has a free
HTA download, called HTA Helpomatic. This HTA builds a window with the
objects you mention and does the operations you mention as you use the HTA
to build HTML and script segments that do what you want. I would suggest
using this HTA as a learning tool do do what you want.
http://www.microsoft.com/downloads/details.aspx?FamilyID=231d8143-f21b-4707-b583-ae7b9152e6d9&DisplayLang=en

-Paul Randall


Rama

unread,
Aug 18, 2008, 9:16:45 PM8/18/08
to

Hi Tom,
I am looking for the VBS procedure to automate a pages operation. ( I
will take any simple html page with checkbox, table with two columns,
dropdown, text boxes....)
And main thing i wanted using HTMLDOM is,
1) take all these page object values (whether checkbox is selected
or not, selected value from dropdown, take values from text box.....)
and place it in the empty text box in the same page.
2) And also values from table of the page and create one xml.

Please help me in this.

- thanks

Rama

unread,
Aug 18, 2008, 9:27:23 PM8/18/08
to
On Aug 19, 12:22 am, "Paul Randall" <paul...@aol.com> wrote:
> "Rama" <gopi9...@gmail.com> wrote in message
> using this HTA as a learning tool do do what you want.http://www.microsoft.com/downloads/details.aspx?FamilyID=231d8143-f21...
>
> -Paul Randall

Hi Paul,
I am very new to vbscript and DOM objects.
Can you please help me with the code using htmldom for above scenario:
any simple html with objects like checkboxes, radiobuttons, table,
dropdown, textboxes. and take all values from these objects, place it
in the textbox. and also values from table should be entered in to
xml.

thanks in advance for your help.

- thanks

Paul Randall

unread,
Aug 18, 2008, 11:24:37 PM8/18/08
to

"Rama" <gopi...@gmail.com> wrote in message
news:46db0d69-fcbf-4dde...@i24g2000prf.googlegroups.com...

- thanks

I don't have a working script that does what you want, and I don't have time
to build a working example and adapt it to your HTML. Download HTA
HelpOMatic and run it. The HTA opens as a full-screen application with a
number of sub-windows. It has a list of HTA elements, most of which are
also HTML elements. There is an area of text that discusses what HTA
HelpOMatic does. When you select one of the HTA elements, the text
discusses that element and the HTML Code window displays sample code for
that type of element, and the Subroutine Code window displays sample code
that could be used with this element, and often, the Sample area at the
bottom shows what the sample HTML code produces on an HTML page, and
includes a "run button" that, when clicked, executes the code in the
Subroutine Code window. Select Textarea from the HTA Elements and click
the Run Button to see how easy it is to put stuff in a text area.

Perhaps after playing with HTA HelpOMatic for a while, you will find that
you can do much of what you want to do and can post questions about those
things you are having problems with.

-Paul Randall


mayayana

unread,
Aug 19, 2008, 8:43:20 AM8/19/08
to
You might take a look at this:
www.jsware.net/jsware/scripts.php5#domed

It's a "WYSIWYG" HTML editor that's designed as
a sample project to demonstrate DOM methods.

It will also help a great deal if you have a copy of
MSDN or some other documentation of the IE DOM.
It's vast, and it's also quirky in the sense that
different HTML elements often don't have the same
properties.

As Paul Randall pointed out, it sounds like you
need to do some research and practice coding
a bit before you'll even know what questions to ask.
For instance, if you asked how to find out whether
a checkbox element is checked, we could tell you that
it has a read/write Boolean Checked property:

Check1.checked = True
If Check1.checked = True then...

But you're asking for the "whole shebang". You're not
likely to find someone here who will just write the
whole script for you for free.

Evertjan.

unread,
Aug 19, 2008, 9:29:24 AM8/19/08
to
mayayana wrote on 19 aug 2008 in microsoft.public.scripting.vbscript:

> For instance, if you asked how to find out whether
> a checkbox element is checked, we could tell you that
> it has a read/write Boolean Checked property:
>
> Check1.checked = True


> If Check1.checked = True then...

A "read/write Boolean Checked property"

Why not:

If ((Check1.checked = True) = True) = True Then

?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

mayayana

unread,
Aug 19, 2008, 9:51:42 AM8/19/08
to
> > If Check1.checked = True then...
>
> A "read/write Boolean Checked property"
>
> Why not:
>
> If ((Check1.checked = True) = True) = True Then
>
You mean as opposed to just:

If Check1.checked Then ... ?

I like my code to be clear and self-explanatory.
I don't see any advantage in brevity or terseness.
But...to each their own.


Dr J R Stockton

unread,
Aug 20, 2008, 12:38:49 PM8/20/08
to
In microsoft.public.scripting.vbscript message <Xns9AFF9D8BEC800eejj99@1
94.109.133.242>, Tue, 19 Aug 2008 13:29:24, Evertjan. <exjxw.hannivoort@
interxnl.net> posted:

>mayayana wrote on 19 aug 2008 in microsoft.public.scripting.vbscript:
>
>> For instance, if you asked how to find out whether
>> a checkbox element is checked, we could tell you that
>> it has a read/write Boolean Checked property:
>>
>> Check1.checked = True
>
>
>> If Check1.checked = True then...
>
>A "read/write Boolean Checked property"
>
>Why not:
>
>If ((Check1.checked = True) = True) = True Then

The following legitimate Borland Pascal program might amuse you (I don't
believe it has a JS or VB equivalent) ::


var true, false : boolean ;

begin true := 1=2 ; false := 1=1 ;
(* or : begin false := true = true ; true := not false ; *)
write(true, ' ', false) end.


Those who consider = true or = false to be necessary or useful
presumably need to study "Logic for Dummies".

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)

Evertjan.

unread,
Aug 20, 2008, 2:00:00 PM8/20/08
to
Dr J R Stockton wrote on 20 aug 2008 in
microsoft.public.scripting.vbscript:

> The following legitimate Borland Pascal program might amuse you (I don't
> believe it has a JS or VB equivalent) ::
>
>
> var true, false : boolean ;
>
> begin true := 1=2 ; false := 1=1 ;
> (* or : begin false := true = true ; true := not false ; *)
> write(true, ' ', false) end.


JS perhaps:

<script type='text/javascript'>
alert(True=false); // false!
</script>

<script type='text/javascript'>
alert(False=true); // true!
</script>

<script type='text/javascript'>
alert(true=false); // script error!
</script>

> Those who consider = true or = false to be necessary or useful
> presumably need to study "Logic for Dummies".

true!important.

0 new messages