I am doing a form validation using and the javascript works with just input fields but not Textboxes. I use:
var _firstname;
var box;
try {
box = $("#firstname");
alert("You must enter a first name");
box.focus();
return false;
}catch{
}
with a front end of :
<div>First Name <span class="required">*</span></div>
<asp:TextBox ID="firstname" name="firstname" runat="server" />
When I debug the code, it adds a body_0$ to the front of the ID (ie: body_0$firstname), so I'm guessing that's why its always popping up with the "You must enter a first name" alert. Is there a work around?