Reputation: 7175
I want to pass php value as parameter in datepicker function. Fuction called perfetly in text box but not in datepicker.when I include datepicker library function is not called.I want to call the function with php value as parameter.Now function is not called.I want to call the function in datepicker onselect event.
#Function called perfectly
echo '<td><input type="text" name="interview" class="interview" value="'.$cfet['interview'].'" onblur=place(this.value,'.$cfet['r_id'].',"interview");></td>';
#problem with datepicker
echo '<td><input type="text" name="interview" id="datepicker1" class="interview" value="'.$cfet['interview'].'" onselect=place(this.value,'.$cfet['r_id'].',"interview");></td>';
Upvotes: 0
Views: 221
Reputation: 1390
INPUT NOT TRIGGERED "ONSELECT" EVENT
You must set that listener on datepicker object
Upvotes: 0
Reputation: 145
check the datepicker library you use, cause often they have those events directly.
Example with JQuery Datepicker:
Change HTML to :
echo '<td><input type="text" name="interview" id="datepicker1" class="interview" value="'.$cfet['interview'].'" data-r_id="'.$cfet['r_id'].'"></td>';
JS Code
$( "#datepicker1" ).datepicker({
onSelect: function(){
place($(this).val(),$(this).data('r_id'),"interview");
}
});
Upvotes: 1