Link to home
Start Free TrialLog in
Avatar of ammarg52
ammarg52

asked on

javascript search control by partial name

I am using javascript and asp.net. I have control by id "txtFirstName" inside template in the grid. aspnet wraps this control by id "ctl00_ContentPlaceHolder1_txtFirstName". I have many pages and multiple templates in my web app. I am looking for solution as to give "txtFirstName" as paarameter to the javascript function and thefunction should find the control with in the page. In this case it is "ctl00_ContentPlaceHolder1_txtFirstName".
ASKER CERTIFIED SOLUTION
Avatar of Sreedhar Vengala
Sreedhar Vengala
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
var hiddenControl = '<%= txtFirstName.ClientID %>';
        document.getElementById(hiddenControl).value=assign new value