Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling click event

Status
Not open for further replies.

DKL01

Programmer
Sep 14, 2000
233
US
Hi,

I have a folder tree structure defined using <DIV> tags. I have several folders ( Project1, Project2, ....)
When I click on &quot;OK&quot; button it should call click event of Project1 ( whose id is &quot;m216Parent&quot; )
Click on &quot;OK&quot; button and clicking on Project1 should perform same function.


<div class=&quot;subFolder&quot; id=&quot;m216Parent&quot;><img class=&quot;icon&quot; src=&quot;images/foldericon.gif&quot;>Project 1</div>

<div class=&quot;subFolder&quot; id=&quot;Parent&quot;><img class=&quot;icon&quot; src=&quot;images/foldericon.gif&quot;>Project 2</div>

<input type=button onclick='ExpandAll()' value=&quot;OK&quot;>

function ExpandAll() {
var oInput = document.all.tags(&quot;DIV&quot;);

for (j=0;j<oInput.length;j++) {
if (oInput[j].id==&quot;m216Parent&quot;){
oInput[j].click(); ----------- not working
}
}

}
 
This is more of a JavaScript q. than an ASP one, but anyway, why don't you just try this:
document.all.m216Parent.click();
and see if it works. If it doesn't, then it's not your function that's the problem. Also, you need to specify an OnClick event in your div tag. It might perform a created &quot;click&quot; on it, but it has to actually run a function when it's clicked to do anything. Harold Blackorby
hblackorby@scoreinteractive.com
St. Louis, MO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top