Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Retrieving control using javascript given a control's id

$
0
0
I am trying to do this right now using multiple user controls on a page. The user control is a file browser control that was written which contains 5 objects, 2 server asp controls and 3 client inputs. What I'm trying to do is get the main page to locate one of the two server controls within the user control for the input that was clicked on.
...
<asp:TextBox ID="Textbox1" runat="server"/>
<input type="button" id="button1"/>
...


in main page
var someValue = '';

function setValueInUC(someValue){
   var sTxtName = 'txt' + someValue;
   document.getElementById(sTxtName).value = someValue;
}


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>