user3386779
user3386779

Reputation: 7175

how to pass php parameter in datepicker function

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

Answers (2)

Taron Saribekyan
Taron Saribekyan

Reputation: 1390

INPUT NOT TRIGGERED "ONSELECT" EVENT

You must set that listener on datepicker object

Upvotes: 0

Thomas Schober
Thomas Schober

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

Related Questions