Team Meeting – Week 10 & 11

admin | WISE
12 Nov 2010

Today I was working on continuing the work on the jQuery validation plugin – finding different methods and creating custom ones.

One of the major problems I had was getting the equalTo method working. Normally if you have

<input type = "password" name = "pass" id = "pass1" /><input type = "password" name = "confirmpass" />

your equalTo method would work like

			pass: {
				required: true,
				minlength: 5
			},
			confirm_password: {
				required: true,
				minlength: 5,
				equalTo: "#pass1"
			}

(Note the difference between pass (which is the name) and pass1 (which is the id).

Now the challenge was to getting this working with the ASP.NET ID, which I had to find how is it generated. Apparently the ID is <%= txtPassword.ClientID %> (which for reasons unknown to me sounds very similar to <%= txtPassword.UniqueID %> So for example you would use it like:

<tr>
       <td>Password</td><td><asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox></td>
   </tr>
   <tr>
       <td>Confirm password</td><td><asp:TextBox ID="txtPasswordConfirm" runat="server" TextMode="Password"></asp:TextBox></td>
   </tr>
$("form").validate({
<%= txtPassword.UniqueID %>: {
minlength: 2,
required: true
},
<%= txtPasswordConfirm.UniqueID %>: {
equalTo: "#<%= txtPassword.ClientID %>"
}
});

Note where we use UniqueID and where we use ClientID. I feel that was a good learning exercise. Also one of the main problems was that Visual Studio would underline certain statements in red as if it had error – and it really didn’t.

Next I was trying to figure out how to use addMethod and return two different messages. And with the way updates are going we won’t be able to deliver the project.

During the week 11 – I was continuing researching the addMethod usage – and I had very less luck – so I decided to scrape that for now. I made improvements to the way error messages were shown – and some UI changes.

I was very skeptical about we delivering the project – because day by day less and less work was getting done.

Leave a Reply