JQuery validation on SharePoint Edit/New Form before the OK button
<p>I used SharePoint at work and our edit form have an appointment date and an end date.  I want the end date to copy whatever the appointment date is. </p>

<p>//Appointment Date<br></p>

<pre><code> $('input[title="Appointment Date"]').blur(function() {
  $('input[title="End"]').val($(this).val());
  });
</code></pre>

<p>This copies the date. (I tried to post a image so you can see but I am not allowed yet)</p>

<p>But they don't have title for hours and minutes.</p>

<p>I can use the long id which is</p>

<p>//Appointment Hour</p>

<pre><code>$('select[name="ctl00$m$g_29cbb5be_bcd6_4949_875d_8fad4732db9b$ctl00$ctl05$ctl09$ctl00$ctl00$ctl04$ctl00$ctl00$DateTimeField$DateTimeFieldDateHours"]').blur(function() {
$('select[name="ctl00$m$g_29cbb5be_bcd6_4949_875d_8fad4732db9b$ctl00$ctl05$ctl11$ctl00$ctl00$ctl04$ctl00$ctl00$DateTimeField$DateTimeFieldDateHours"]').val($(this).val());
  });
</code></pre>

<p>//Appointment Min</p>

<pre><code>$('select[name="ctl00$m$g_29cbb5be_bcd6_4949_875d_8fad4732db9b$ctl00$ctl05$ctl09$ctl00$ctl00$ctl04$ctl00$ctl00$DateTimeField$DateTimeFieldDateMinutes"]').blur(function() {
$('select[name="ctl00$m$g_29cbb5be_bcd6_4949_875d_8fad4732db9b$ctl00$ctl05$ctl11$ctl00$ctl00$ctl04$ctl00$ctl00$DateTimeField$DateTimeFieldDateMinutes"]').val($(this).val());
  });
</code></pre>

<p>but I am afraid the name id will change over time. </p>

<p>I tried doing</p>

<pre><code> $("label:contains('Appointment Date Hours')").blur(function(){
$("label:contains('End Hours')").next.($(this).next().val()).val();
});  &lt;--- This doesn't work  
</code></pre>

<p>Maybe its written in a wrong way but I can't figure it out. I tried doing <code>.next().val($(this).next().val());</code>but it didn't work</p>

<p>i got that label from</p>

<p><code>var apptHour = $("label:contains('Appointment Date Hours')").next().val();</code> in our javascript valdiation</p>

<p>Also, I know the text is called "Appointment Date Hours" because I found it using the developer tools from IE.</p>
