I'm simply trying to set a value for an input but it doesn't work. Here is my jquery function :
function display_form() {
try {
$('#start_date').val('2012/08/21');
} catch (e) {
alert('error');
}
// window.alert($('[name=start_date]').val()); (shows "undefined")
$('#add-event').show();
}
This is how display_form is called:
$(document).ready(function() {
$('#calendar').fullCalendar({
dayClick: function(date, allDay, jsEvent, view)
{
date_format = $.fullCalendar.formatDate(date,"yyyy-MM-dd HH:mm:ss");
display_form();
return false;
},
events: 'https://www.google.com/calendar/feeds/myLogin%40gmail.com/public/basic'
});
});
This shows "undefined". Here is my form :
<input id="start_date" name="start_date" type="text" size="6" />
Should I put somewhere the id of the form that I want to use? I just followed what is said in the documentation of jquery but it doesn't seem to work. Could anyone help me ?