I have a calendar I display with only certain dates available and the rest disabled. I get all my dates and make up my calendar and it displays without problem
<script type="text/javascript">
$(function() {
$.post('/jreqlib',
{ Action: 'GetDates',
}, function(data) {
var myNewDates = new Array;
for (var x = 0; x < data['validPubDates'].length; x++) {
myNewDates.push(data['validPubDates'][x]);
}
var myValidDates = new Array;
for (var x = 0; x<data['validPubDates'].length; x++) {
var theDate = data['validPubDates'][x];
myValidDates.push(theDate);
}
$('#inlineDatepicker').datepick({
multiSelect: 999,
minDate : '-14d',
maxDate : '+2y',
onSelect : function (dateText, inst) {
//alert("Clicked');
//$("#FormId").click();
$(this).parent('form').submit();
},
onDate : getAllowed(myValidDates),
}).datepick('setDate',myNewDates);
},
'json');
});
</script>
The issue is I want to submit the form (not via ajax) when a date is clicked. I found a bunch of posts but none of them seemed to work. If I un-comment that "alert" then I see the "clicked" message but neither the $("#FormId").click(); (yes the form has a id="FormId" in it)
or $(this).parent('form').submit();
or the 2 or 3 other ways I found to do the form submit.
I'm getting there on the click, the alert will fire if un-commented, how come the form won't submit?
(BTW - I didn't post the getAllowed function as I didn't think it relevant but I will if needed)
TIA
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…