Hi,
I have a form that has client and server side controls. I have a problem in that
any client controls (textbox) within the form runat="server" can not be accessed
with client side code.
Anyone got any ideas why and what work arounds are possible.
Regards,
Graham.
![]() |
0 |
![]() |
once a form element is inside a
![]() |
0 |
![]() |
use document.getElementById(yourtextboxid) to get a ref to the element in the form. using this allows u to bypass the formname. but you must have dom compliant browser like IE.
i use a wrapper function to get objects in my clientside scripting... something like...
////////////////////////////////////////////////
// find an element and return object for it
function getRef(id)
{
try {
return document.getElementById(id);
}
catch (error) {
var sAlert = 'ERROR: fnc {getRef} return the following error: ';
sAlert += '[ ' + error.number + '] - ' + error.description;
alert(sAlert);
}
}
a little bit over the top but saves a lot of typing... J
![]() |
0 |
![]() |