-1

i'm still learning PHP, i have a table and have a update form to update the data.for update the data i'm using a Modal. so when i want to update the data in the table i just click the "update" button and then the popup menu for update the data will be show. for example in the update menu i have a name and time. for name, if i want to showed previous name in the text box i use this code: value="<?php echo $row_menu['name']; ?>" required> and the previous name will be displayed in the text box. so how about the time?how to displayed the previous time?? image for my Modal Form

and for the time i'm use this code

<div class="form-group">
    <label>Time Start</label>
    <input type="Time" name="time">
</div>

i don't know how to set the "value" for timepicker to show the previous time. sorry for the bad english i hope you all understand what i mean

Sinto
  • 3,915
  • 11
  • 36
  • 70

1 Answers1

0

You have to set the value in input when page load or whenever the popup button open.

For this ,you have to write the below code:

var value = '<?php echo $valueforthis; ?>'
$('input[name="time"]').timepicker({defaultTime: value});

Please try this.

Madhuri Patel
  • 1,270
  • 12
  • 24