View Full Version : How to find control in formview from javascript

03-11-2009, 12:54 AM
I'm trying to retrieve the value of a text box "txtDrumNumber" so I can run a validation script. I can't seem to get the correct method for this. Here is what has been suggested but didn't work.

<script type="text/javascript">
function isValidDrumNumber(sender, args) {
var DrumNumber = fvAddNewDrum.FormviewRow.FindControl("txtDrumNumber").ClientID;
var DrumString = DrumNumber.value;
if (DrumString.length = 11) {
return true;
else {
args.IsValid = false;
return false;

03-11-2009, 08:59 AM
var value=document.getElementById('myinput');

<input type="text" name="myinput" id="myinput">
The above should work in all cases(with no major errors in markup).

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum