R
Radu
Hi,
I have a complicated page... including a repeater, an SqlDataSource
with FilterParameters, etc.
Anyway, on each row of the repeater I have, among others:
a combo-box named "cboLocations",
a textbox named "txtNewLocation"
and another textbox named "txtNewValue".
My idea is to allow the user to override any selection in cboLocations
by entering some text in txtNewLocation and a numeric value
corresponding to the new location in txtNewValue. I would like to have
a custom validator control checking the following:
*********
if the user entered something in txtNewLocation, then txtNewValue is
mandatory AND the text in txtNewValue should be numeric.
**********
If there is text in txtNewValue I could simply disregard it if there's
nothing in txtNewLocation.
I will write some VBNet function on the CustomValidator_ServerValidate
event.... On the client side, however, I would like to know how to
write the JavaScript function to accomplish the stated goals, above. I
have started by saying
function checkNewValue()
{
if (document.getElementById("txtNewLocation").value == "")
{
}
}
but the browser says "Error: Object required"..... Is it because
txtNewLocation is inside the repeater, and therefore cannot be found
???
I am a completely 'naive' in JavaScript, so please bear with me ! )
Thank you VERY much
Alex.
I have a complicated page... including a repeater, an SqlDataSource
with FilterParameters, etc.
Anyway, on each row of the repeater I have, among others:
a combo-box named "cboLocations",
a textbox named "txtNewLocation"
and another textbox named "txtNewValue".
My idea is to allow the user to override any selection in cboLocations
by entering some text in txtNewLocation and a numeric value
corresponding to the new location in txtNewValue. I would like to have
a custom validator control checking the following:
*********
if the user entered something in txtNewLocation, then txtNewValue is
mandatory AND the text in txtNewValue should be numeric.
**********
If there is text in txtNewValue I could simply disregard it if there's
nothing in txtNewLocation.
I will write some VBNet function on the CustomValidator_ServerValidate
event.... On the client side, however, I would like to know how to
write the JavaScript function to accomplish the stated goals, above. I
have started by saying
function checkNewValue()
{
if (document.getElementById("txtNewLocation").value == "")
{
}
}
but the browser says "Error: Object required"..... Is it because
txtNewLocation is inside the repeater, and therefore cannot be found
???
I am a completely 'naive' in JavaScript, so please bear with me ! )
Thank you VERY much
Alex.