It works.
In order to see the whole input tag element and its
attributes I have to write something like
puts variable.each{|i| print i.class, i.name,
i.value, "\n"}
Is
this correct?
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sergio Pinon Sent: Monday, January 23, 2006 2:51 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Tricky checkbox selection If you are trying to
see information about these object then try something like the
following: variable =
$ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts
variable.each{|i| print i.value, "\n"} Add the value property
on to the end of your object. So you see I did i.value. That should show you the
value. Sergio From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Paatsch,
Bernd variable =
$ie.getDocument().getElementsByName('cbxSelectGroup[]'); puts
variable.each{|i| print i, "\n"} As I said, I am new to
_javascript_ and ruby. The code
returns: #<WIN32OLE:0x2a961b8> etc. which I believe
represents memory locations? How can I get the
values? From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Sergio
Pinon Did you try the method
I gave you? I wanted to know if it worked. Sergio From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Paatsch,
Bernd The table is generated
by an underlining database and the values are different almost every
time. <tr>
<td> <input type="checkbox" name="Add_member[]"
value="25"> </td> <td> Test1 </td></tr>
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Cain,
Mark You don’t need to just
try something like this. $ie.checkbox(:name,
/Add_member/i, “35”).set You can use regular
expressions for your attribute name if you know part of what that name will be
at runtime—although it does get tricky when attribute names for an object are
the same, in that case you can use :index. Indexes are 1 based currently
(although I heard some rumbling as to think they will soon be zero based) and
start with the first one on the page and continue through the last one on the
page. --Mark From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Paatsch,
Bernd I have almost none
_javascript_ experience. How do I get the underlying _javascript_ object of that
page? From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Sergio
Pinon Well the other thing to
do is try the code below. What you do is get the underlying _javascript_ object of
the page and then interact with it as you would with _javascript_. You get all the
elements with the name you supply and then access the one you want using the
indexer on that array. Then you just set the checked property of that object to
true and it should work. Let me know how it turns
out. ie_browser.getDocument().getElementsByName(“Add_member[]”)[index
of control].checked = true; From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Paatsch,
Bernd Unfortunately I do not
know the value beforehand. From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Sergio
Pinon Do you know the value
of the checkbox beforehand? If you do then just use this
method: Ie_browser.checkbox(:name,
“Add_member[]”, “35”).set(); This should be good to
go. Sergio From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Paatsch,
Bernd Hello, I
have following html code and like to select the checkbox for "Test3". How can I
do that? <input type="checkbox"
name="Add_member[]" value="25"></td><td>
Test1</td><td>
Subscriber</td><td>208</td></tr> Thanks.
|
_______________________________________________ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general