How do I pass other HTML control in HTML control's click event using Javascript ?

Hello friends, Please give any idea for  how do I pass HTML control to Javascript code.  exam given below..
function SwitchTLStateTreeList1($nodeValue,$imgBtn)
 $mode = 'table-row';  
if ($ != -1)
    $imgBtn.src = $imgBtn.src.replace(/collapse/g,'expand');
    $mode = 'none'; 
else if ($ != -1) 
 $imgBtn.src = $imgBtn.src.replace(/expand/g,'collapse');
    $mode = 'table-row';  
--------------------------------------------------------------------------------------------------------------when I click on HTML button, other HTML image control send to javascript code.for example
Other control : <input type="image" name="ctl00$ContentPlaceHolder1$ctl21" ID="imgTreeNode1496" src="images/icon_expand_end.gif" style="border-width:0px;vertical-align:middle;" />
Main Control : <input onclick='SwitchTLStateTreeList2({ID},this);return false;' type='image' name='ctl00$ContentPlaceHolder1$ctl21' ID='imgTreeNode' src='../Images/arrow-right.gif'/> 
I want to send other control in main control with javascirpt code instead of 'this'.
Please help me ASAP,
Thanks & Regards,
Rupendra Bensh


7/20/2008 9:16:06 AM 24353 articles. 2 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 52
Get it on Google Play
Get it on Apple App Store

<input onclick="SwitchTLStateTreeList2({ID}, document.getElementById('" + yourControl.ClientID + "');return false;" ...


7/21/2008 1:02:55 PM

Similar Artilces:

How to access dynamically Html controls (client side controls) using C# server side scripts
Folks,I have problem try to to access dynamically Html controls (client side controls) using C# server side scripts. Please give me helps.     The error is as follows Exception Details: System.InvalidCastException: Specified cast is not valid.Source Error: Line 79: { Line 80: Control c = Page.FindControl("ddlTC" + i); Line 81: ((DropDownList)c).DataSource = mdt; Line 82: ((DropDownList)c).DataTextField = "ClassID"; Line 83: ((DropDownList)c).DataValueField = "Course"; My aspx page source codes: ...<...

Is there a correspondance for each server side control to be equivalent to a client side html control
Where can find the list and can use that equivalence and what is its usage plsThanksThanks a lot, I appreciate your taking the time to help me. What exactly do you mean? A correspondence of what?All controls have a ClientID property, which for most controls tells the DOM element ID that will be used in the HTML rendering. Aside from that certain controls might offer additional client-side functionality, but there's no one standard.Thanks,EilonBlog: I mean. When I am using html control in my aspx page like:  <input type=text ..>  and...

Modifing javascript to use server controls instead of using html controls
Hi, I use a Javascript to create a textbox that converts English to Hindi text. I am using it in my aspx pages. I use another javascript to access the Text of this HTML textbox.  Everything is fine when I use Single TextBox on a page. But the complexities go out of my control when i need to use 5 such textboxes on the same aspx page. Moreover I encounter issues of ID of ASP.NET controls that get changed as there are ContentPlaceHolders, TabPanels etc. I don't know the javascript things so deeply that I can comprehend the code that generates the custom Textbox. Now I ne...

ISSUE WITH Control's behaviour inisde UPDATE PANEL
 hii evry1..,             i have an strange chk it out..                      aspx page:            < asp:UpdatePanel ID="OUpdatePanel" runat="server" >                <ContentTemplate>             &nbs...

Can I hide a user control's control from the hosting page's client script?
Okay, my previous question was not unswered and I guess you can't hide a control's panel with server code then show it with client code. Now this is what I try to do: on the hosting page's onload event, call a function to hide the user control's penal. Here is the deal: the user control was looped as many times as data required. So the penals will be name mypanel1, my panel2, etc... that is not even a problem if I know if the following is true: * Do all server codes finish running before the page get sent back to the client? Say the database gave me 5 penals, I can then determine how...

Calculate an HTML Control's Width in Javascript
How do I calculate a controls width in JavaScript, i.e. = - 5; The above commands gets an error because is not numeric (150px). How do I convert to a numeric so that I can perform a calculation? Thanks in advance, Mike - Cache entire web sites at the client and server and keep cache current. Cache just got easier! .... not absolutely sure, but try: = (parseInt( - 5); or = (parseInt(ddl.offsetWidth) - 5); Hth, Moon What exactly are you trying t...

How to ignore child control's mouse events and pass them to parent control?
I am creating a FMX TNewTrackbar component that has has two TRectangle controls, one inside of the other. The ChildRect changes in size and can occupy the entire ParentRect, or a small portion of it. If I mouse over/click the ParentRect everything is processed fine by the original TTrackBar component. But when a mouse event (move or click) occurs on ChildRect, nothing happens because ChildRect eats the event. I'd like the ChildRect to be "uneventful" for lack of a better word. I'd like the underlying ParentRect to handle all of the mouse events. Is there a simple way...

Label control's text doesn't appear to be set (in the page which has a user control )when trying to update the text property in the FormView's ItemUpdated event
Hi There,I have a user control which hosts a formview control, gridview control and a label control. The grid view is usedto show rows in the DB and when clicked to edit each row, a form view opens up in edit mode with that particular row info. So I have nothing in the item template.My first question it mandatory to have smth in the itemtemplate of the form view.I have controls in edititemtemplate and insertitemtemplate.When a particular row is edited, I would like to show a status msg showing that the row has been updated.For this, I use the ItemUpdated event of the formview and try ...

Who uses Web Controls/HTML Controls?
I'm currently making the migration from ColdFusion to and I have a few questions. 1. Does anybody really use the Web/HTML Controls? CF has something similar <cfform> but I never use it because I'm a believer in separating html from application logic/control. And I like being in control of what goes on in my apps. However, I find the Web/HTML Controls interesting. 2. Is there a standard framework that people use to organize their code? I like using MVC (Model, View, Controller) to create true N-tier applications. Just wondering what others use. 3. Is anybody using Flash...

When to use web control and Html control
I am designing a web application in which onclick a form becomes visible containing set of text boxes and other fields. How shoud I design it. I am not able to figure out difference between web form controls and html controls. Shrinivas...

Use HTML controls to write html?
What I need to accomplish is to programatically "write" html. I dont want to build an html string manually, but have an object write it for me as I manipulate the object's properties and methods. For reasons too numerous to explain here, I'm not building this html in an page, but in a class contained in a windows app. I just didnt know where else to post this one. Does any of this even make sense? Thanks in advance for anyone's help!Anthony KilhofferRock Hammer Media, LLC Basicly you're going to endup building the html string. You can create a class with different proper...

Passing Html controls value to Controller
Alright, I have dynamically created Html controls using Html Helper. Now, to pass data to my controller I use Request.Form in code-behind and create Session variables with the results, so I can read them from my controller. Is there a "Better" way to pass data to controller, knowing that I have dynamically created controls, from which I want to retreive value Thanks for help You can pass data from controller to view using ViewData (I think that it is not your problem). If you want to process data from HTML Form then you do it using Request.Form directly. But in MVC th...

hi, how to export xul's js object to browser control's html context?
hi, man, In xul, we can embed <script></script> to execute js code to control xul UI, and I define some objects, want to let them accessable in html page in one browser control, how should I do? Thank you! Tang Daogang wrote: >In xul, we can embed <script></script> to execute js code to control xul UI, and I define some objects, want to let them accessable in html page in one browser control, how should I do? > Maybe this will help you: ...

How do YOU build your server controls? Using writer to output html or using controls?
What's the preferred way of overriding Render when building server controls?  Is it better to use the writer to output the html with RenderBeginTag and etc, or is it better to just create a table/panel control and add controls to it and render the table/panel control?For example, let say I want to create a server control to output the following in html<table>   <tr>      <td>         Welcome      </td>      <td&g...

Web resources about - How do I pass other HTML control in HTML control's click event using Javascript ? -

Resources last updated: 1/16/2016 3:01:34 PM