now im making form using PHP code. I combine with ajax code. inside the form contain input type="radio"
, <textarea></textarea>
and dropdown list.
i create ajax code like this
$.ajax({
url: 'index.php?route=data/save',
type: 'post',
data: $('#save-method input[type=\'radio\']:checked, #save-method textarea, #save-method option:selected'),
dataType: 'json',
when debug it. i able to get name and value for radio and textare. but for dropdown, im only able to get the value.
{
data: {
room: "room.4",
undefined: "2021-03-26",
comment: "please ontime"
}
}
- "room" is radio name
- "comment" is textarea name
- but for dropdown it display "undefined".
i set the dropdown like this
<select name="set_schedule" >
<option value="2021-03-26">2021-03-26</option>
<option value="2021-03-27">2021-03-27</option>
</select>
how do i able to get dropdown name using my ajax code.
please help