You are viewing limited content. For full access, please sign in.

Question

Question

Before submit forms, can I retrieval the data I just put in?

asked on August 18, 2015

I create a form with date (id=q1,class name = calendardate) input. before the submit form, I have a javascript need this value. I try to use the code as

var minDate =  $('.calendardate input').val(); 
var minDate =  $('#q1 input').val();

to get the value. But I cannot get the value

Any help? Thanks a lot.

0 0

Answer

APPROVED ANSWER
replied on August 18, 2015

Try using the jquery on change function to watch for when the date field changes and then set the value into your variable then.

$('.calendardate input').on('change', function() {
  var minDate = $('.calendardate input').val();
});
0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.