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
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/
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
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
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
- 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
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.
> 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)
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.
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)
> 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.