|
|
|
date: Thu, 15 Sep 2005 01:38:56 +0800,
group: microsoft.public.inetsdk.programming.html_objmodel
back
Re: <SELECT> and <OPTION>
"Brian Burgess" wrote in message
news:%23f2bldHvFHA.3500@TK2MSFTNGP09.phx.gbl
> Ok .. Do you know what it is supposed to do then?
I won't be surprised if it's not supposed to do anything. click() is a
method on IHTMLElement, which means that every single HTML element has
it. For some of them, it makes sense and actually does something (e.g.
buttons). For others, it does nothing at all (e.g. <div> or <span> ).
click() is, however, supposed to fire whatever onclick handler is
attached, in all cases. Are you sure it doesn't for you?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Sun, 18 Sep 2005 23:32:11 -0400
author: Igor Tandetnik
Re: <SELECT> and <OPTION>
Well .. reasonably sure I guess. In this case the SELECT has a unique
name. When I return the name to a message box it is the correct name.
I CAN however set the value on the SELECT. I can set it to any of its
OPTION values. This however does not allow the client-side java script
SELECT event handler to execute. This event handler populates a second
SELECT, which needs to be done in order for the page to function properly.
This is a third-party site which I am trying to automate, so I cant change
the page.
Also there is a login page preceding this page. This login page has a
'submit' button on it. When I use the 'click' method on this submit
button, it does work here.
Thx
-B
"Igor Tandetnik" wrote in message
news:ea4y1qMvFHA.2312@TK2MSFTNGP14.phx.gbl...
> "Brian Burgess" wrote in message
> news:%23f2bldHvFHA.3500@TK2MSFTNGP09.phx.gbl
>> Ok .. Do you know what it is supposed to do then?
>
> I won't be surprised if it's not supposed to do anything. click() is a
> method on IHTMLElement, which means that every single HTML element has it.
> For some of them, it makes sense and actually does something (e.g.
> buttons). For others, it does nothing at all (e.g. <div> or <span> ).
>
> click() is, however, supposed to fire whatever onclick handler is
> attached, in all cases. Are you sure it doesn't for you?
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
date: Mon, 19 Sep 2005 14:49:55 +0800
author: Brian Burgess
Re: <SELECT> and <OPTION>
"Brian Burgess" wrote in message
news:%23reAjZOvFHA.3188@TK2MSFTNGP14.phx.gbl
> I CAN however set the value on the SELECT. I can set it to any of
> its OPTION values. This however does not allow the client-side java
> script SELECT event handler to execute. This event handler
> populates a second SELECT, which needs to be done in order for the
> page to function properly. This is a third-party site which I am
> trying to automate, so I cant change the page.
That's an onchange event, not an onclick. click() has nothing to do with
it. I believe you do need to fire onchange manualy, using one of the
techniques I referred to in this thread.
> Also there is a login page preceding this page. This login page
> has a 'submit' button on it. When I use the 'click' method on this
> submit button, it does work here.
I remember mentioning that click() does work for buttons.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Mon, 19 Sep 2005 07:54:56 -0400
author: Igor Tandetnik
Re: <SELECT> and <OPTION>
Yes I realize that, it is why it is mentioned .. again.
Neither method (firing onclick or onchange) populates the second SELECT.
Neither sending the desired value to the first SELECT nor 'click'ing it
fills the second SELECT with the needed OPTIONs.
You had mentioned once that you didn't think that a 'click()' should
dropdown a SELECT (which doesn't make sense to me), but you had not
mentioned before that executing a 'click()' on a button presses the button.
I guess all this vagueness is why it is still unclear to me.. :-$
-B
"Igor Tandetnik" wrote in message
news:OZ4ZxDRvFHA.2504@TK2MSFTNGP15.phx.gbl...
> "Brian Burgess" wrote in message
> news:%23reAjZOvFHA.3188@TK2MSFTNGP14.phx.gbl
>> I CAN however set the value on the SELECT. I can set it to any of
>> its OPTION values. This however does not allow the client-side java
>> script SELECT event handler to execute. This event handler
>> populates a second SELECT, which needs to be done in order for the
>> page to function properly. This is a third-party site which I am
>> trying to automate, so I cant change the page.
>
> That's an onchange event, not an onclick. click() has nothing to do with
> it. I believe you do need to fire onchange manualy, using one of the
> techniques I referred to in this thread.
>
>> Also there is a login page preceding this page. This login page
>> has a 'submit' button on it. When I use the 'click' method on this
>> submit button, it does work here.
>
> I remember mentioning that click() does work for buttons.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
date: Mon, 19 Sep 2005 20:58:03 +0800
author: Brian Burgess
Re: <SELECT> and <OPTION>
Well the public URL requires a login which I cannot send for legal reasons.
But I can send the HTML that has the client script in it. It is from a
<FRAME>... shown below.
In the mean-time I have another idea ... is it possible to send a keystroke
to an element? Like set the focus to this SELECT and then send it a
down-cursor keystroke?
***********HTML**********************
<HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content=text/html;charset=big5><LINK
href="../style/default/main.css" type=text/css rel=stylesheet>
<SCRIPT language=javascript>
var grpALL = "4124,5687";
var grptxtALL = "85262534051 Testing`85262534382 Testing 2 card";
function reloadGroup(gid, tid){
if ((typeof(gid) == 'undefined' || gid.length == 0)
&& (typeof(tid) == 'undefined' || tid.length == 0)
&& document.f1.group.selectedIndex == 0) {
document.f1.member.length = 1;
return;
}
var plen = document.f1.member.length;
for (var i = 1; i < plen; i++) {
document.f1.member.options[i] = null;
}
document.f1.srcdate.value="";
var grpid = "";
if (typeof(gid) == 'undefined' || gid.length == 0) {
grpid = document.f1.group[document.f1.group.selectedIndex].value;
document.f1.srcdate.value="";
document.f1.year.value="";
document.f1.month.value="";
document.f1.target = "_self";
document.f1.action = "left.php";
document.f1.submit();
} else {
grpid = gid;
var glen = document.f1.group.length;
for (var i = 0; i < glen; i++) {
if (document.f1.group.options[i].value == gid) {
document.f1.group.options[i].selected = true;
}
}
}
var grpstr = eval('grp'+grpid);
var grptxtstr = eval('grptxt'+grpid);
var grp = grpstr.split(',');
var grptxt = grptxtstr.split('`');
var grplen = grp.length;
for (var k = 0; k < grplen; k++) {
var newoption = new Option(grptxt[k], grp[k]);
document.f1.member.options[k+1] = newoption;
if (tid == grp[k]) {
document.f1.member.options[k+1].selected = true;
}
}
document.f1.member.length = grplen + 1;
}
function reloadMember(){
if (document.f1.member.selectedIndex == 0) {
return;
}
document.f1.srcdate.value="";
document.f1.year.value="";
document.f1.month.value="";
document.f1.target = "_self";
document.f1.action = "left.php";
document.f1.submit();
}
function reload() {
curgrp = document.f1.curgrp.value;
curtid = document.f1.curtid.value;
reloadGroup(curgrp, curtid);
//parent.location.reload();
}
function prev() {
if (document.f1.group.selectedIndex == 0 ||
document.f1.member.selectedIndex == 0) {
alert("Please select a group and a member");
return;
}
document.f1.target = "_self";
document.f1.action = "left.php";
document.f1.act.value = "prev";
document.f1.submit();
}
function next() {
if (document.f1.group.selectedIndex == 0 ||
document.f1.member.selectedIndex == 0) {
alert("Please select a group and a member");
return;
}
document.f1.target = "_self";
document.f1.action = "left.php";
document.f1.act.value = "next";
document.f1.submit();
}
function setDate(d) {
year = document.f1.year.value;
month = document.f1.month.value;
day = new String(d);
if (day.length == 1) {
day = "0" + day;
}
var srcdate = "" + year + "-" + month + "-" + day;
document.f1.srcdate.value = srcdate;
}
function presubmit() {
if (document.f1.group.selectedIndex == 0 ||
document.f1.member.selectedIndex == 0) {
alert("Please select a group and a member");
return false;
}
if (document.f1.srcdate.value == "") {
alert("Please select a date in calendar");
return false;
}
document.f1.target = "main";
document.f1.action = "trans.php?reset=true";
return true;
}
function checkherf(herf) {
var bflag = true;
if (document.f1.group.selectedIndex == 0 ||
document.f1.member.selectedIndex == 0) {
alert("Please select a group and a member");
bflag = false;
return false;
}
if (document.f1.srcdate.value == "") {
alert("Please select a date in calendar");
bflag = false;
return false;
}
if(bflag && herf == 'map')
{
document.f1.action = "map.php?reset=true";
document.f1.target = "main";
document.f1.submit();
}
if(bflag && herf == 'tab')
{
document.f1.action = "indiv_street.php";
document.f1.target = "main";
document.f1.submit();
}
return true;
}
</SCRIPT>
</HEAD>
<BODY text=#666666 vLink=#0099ff aLink=#0099ff link=#0099ff bgColor=#ffffff
leftMargin=0 background=images/left_bg.gif topMargin=0 onload=reload();
marginwidth="0" marginheight="0">
<FORM name=f1 action=map.php method=post target=main><INPUT type=hidden
name=curgrp> <INPUT type=hidden name=curtid> <INPUT type=hidden name=act>
<INPUT type=hidden value=2005 name=year> <INPUT type=hidden value=09
name=month> <INPUT type=hidden name=type> <INPUT type=hidden value=history
name=trackindividual>
<TABLE cellSpacing=0 cellPadding=0 width=200 border=0>
<TBODY>
<TR bgColor=#ffffff>
<TD><IMG src="images/empty.gif"></TD>
<TD align=left cellspacing="0" cellpadding="0" border="0"><A
style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM:
0px" href="left.php?type=1"><IMG hspace=0 src="images/tab1a_en.gif" border=0
cellspacing="0" cellpadding="0"></A><A style="BORDER-RIGHT: 0px; BORDER-TOP:
0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" href="left.php?type=2"><IMG
hspace=0 src="images/tab1b_en.gif" border=0 cellspacing="0"
cellpadding="0"></A><A style="BORDER-RIGHT: 0px; BORDER-TOP: 0px;
BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" href="left.php?type=3"><IMG hspace=0
src="images/tab1c_en.gif" border=0 cellspacing="0" cellpadding="0"></A></TD>
<TD></TD>
<TD></TD></TR>
<TR>
<TD><IMG height=10 src="images/empty.gif" width=2></TD>
<TD><IMG src="images/empty.gif"></TD>
<TD><IMG src="images/empty.gif"></TD>
<TD><IMG src="images/empty.gif"></TD></TR>
<TR>
<TD><IMG src="images/empty.gif"></TD>
<TD class=txt11 colSpan=3><FONT color=#cc0000>Step 1:</FONT> Select
Group<BR><SELECT class=dropdown style="WIDTH: 170px" onchange=reloadGroup();
name=group> <OPTION value="" selected>Select a group</OPTION> <OPTION
value=ALL>[ALL]</OPTION></SELECT> </TD></TR>
<TR>
<TD class=txt11 align=middle colSpan=4><IMG height=9
src="../style/default//left_arrow.gif" width=9 vspace=7></TD></TR>
<TR>
<TD><IMG src="images/empty.gif"></TD>
<TD class=txt11 colSpan=3><FONT color=#cc0000>Step 2:</FONT> Select
Number<BR><SELECT class=dropdown style="WIDTH: 170px"
onchange=reloadMember(); name=member> <OPTION value="" selected>Select a
Number</OPTION></SELECT> </TD></TR>
<TR>
<TD class=txt11 align=middle colSpan=4><IMG height=9
src="../style/default//left_arrow.gif" width=9 vspace=7></TD></TR>
<TR>
<TD><IMG src="images/empty.gif"></TD>
<TD class=txt11 align=left colSpan=3><FONT color=#cc0000>Step 3:</FONT>
Select Date<BR><BR></TD></TR>
<TR>
<TD><IMG src="images/empty.gif"></TD>
<TD class=txt11 align=middle colSpan=3><!-- calendar -->
<TABLE cellSpacing=0 cellPadding=0 width=160 bgColor=#ffffff border=0>
<TBODY>
<TR class=calender>
<TD align=middle><A href="javascript:prev();"><IMG height=20
src="../style/default//calender1.gif" width=6 border=0></A></TD>
<TD class=calender align=middle colSpan=5><B><FONT color=#ffffff>September
2005</FONT></B></TD>
<TD align=middle><A href="javascript:next();"><IMG height=20
src="../style/default//calender2.gif" width=6 border=0></A></TD></TR>
<TR align=middle>
<TD class=calender width=22><FONT color=#ff6600>Sun</FONT></TD>
<TD class=calender width=22><FONT color=#999999>Mon</FONT></TD>
<TD class=calender width=22><FONT color=#999999>Tue</FONT></TD>
<TD class=calender width=22><FONT color=#999999>Wed</FONT></TD>
<TD class=calender width=22><FONT color=#999999>Thu</FONT></TD>
<TD class=calender width=22><FONT color=#999999>Fri</FONT></TD>
<TD class=calender width=22><FONT color=#999999>Sat</FONT></TD></TR>
<TR align=middle>
<TD class=calender> </TD>
<TD class=calender> </TD>
<TD class=calender> </TD>
<TD class=calender> </TD>
<TD class=calender>1</TD>
<TD class=calender>2</TD>
<TD class=calender>3</TD></TR>
<TR align=middle>
<TD class=calender>4</TD>
<TD class=calender>5</TD>
<TD class=calender>6</TD>
<TD class=calender>7</TD>
<TD class=calender>8</TD>
<TD class=calender>9</TD>
<TD class=calender>10</TD></TR>
<TR align=middle>
<TD class=calender>11</TD>
<TD class=calender>12</TD>
<TD class=calender>13</TD>
<TD class=calender>14</TD>
<TD class=calender>15</TD>
<TD class=calender>16</TD>
<TD class=calender>17</TD></TR>
<TR align=middle>
<TD class=calender>18</TD>
<TD class=calender>19</TD>
<TD class=calender>20</TD>
<TD class=calender>21</TD>
<TD class=calender>22</TD>
<TD class=calender>23</TD>
<TD class=calender>24</TD></TR>
<TR align=middle>
<TD class=calender>25</TD>
<TD class=calender>26</TD>
<TD class=calender>27</TD>
<TD class=calender>28</TD>
<TD class=calender>29</TD>
<TD class=calender>30</TD>
<TD class=calender> </TD></TR></TBODY></TABLE><BR><BR></TD></TR>
<TR>
<TD><IMG src="images/empty.gif"></TD>
<TD class=txt11 colSpan=3>Selected Date: <INPUT readOnly maxLength=10
size=10 name=srcdate> <BR><BR></TD></TR>
<TR>
<TD class=txt11 align=middle colSpan=4><INPUT class=button onclick="return
presubmit();" type=submit value="Show History" name=""> <BR><BR></TD></TR>
<TR>
<TD><IMG src="images/empty.gif" width=2></TD>
<TD class=txt11 colSpan=3>| <A onclick="checkherf('map');return false;"
href="">show map only</A> |<BR>| <A onclick="checkherf('tab');return false;"
href="">show table only</A> |<BR></TD></FORM></TR></TBODY></TABLE>
<SCRIPT language=javascript>parent.main.location="main.php"</SCRIPT>
</BODY>
***************************************
"Igor Tandetnik" wrote in message
news:%23LTuWGSvFHA.3500@TK2MSFTNGP09.phx.gbl...
> Brian Burgess wrote:
>> Neither method (firing onclick or onchange) populates the second
>> SELECT. Neither sending the desired value to the first SELECT nor
>> 'click'ing it fills the second SELECT with the needed OPTIONs.
>
> You will have to figure out exactly how the script knows when to populate
> the second drop-down. If you have a publicly accessible URL, I'll look at
> it.
>
>> You had mentioned once that you didn't think that a 'click()' should
>> dropdown a SELECT (which doesn't make sense to me), but you had not
>> mentioned before that executing a 'click()' on a button presses the
>> button.
>
> It does not exactly press the button (there is no change in visual
> appearance) - it triggers the same processing that normally triggers when
> the user clicks the button. click() does not imitate a physical mouse
> click, it imitates a default action should one be associated with an
> element.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
date: Mon, 26 Sep 2005 11:01:46 +0800
author: Brian Burgess
|
|