Issue in getting the date in js function

This is my select field in html where I am passing the id and date which are stored in php variable to the js function by calling onchange event

        <select  id="student_id-'.$id.'-'.$date.'" onchange="fun3('.$id.','.$date.')" name = "roll">
       <>option values=""></option>

Upto here I am getting $id and $date properly as($date = 2019-06-27)

and this is how I have created the fun3 function in js

         function fun3(id,date) {
        some code 

when I tried to know if I am getting correct values in this function by alert() then I am getting id correctly but after alerting date I am getting value as 2014 ,instead of 2019-06-27
I don’t know why , what should I do to fix it ?

Well for starters you should show us the rest of your code, so we can see where you’re getting $date from and why you think it should be one thing but it’s actually another thing.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.