For a normal text box I wrote this:
$SUL("#txtlinkid").val(json[0].linkurl);
The information is prefilling automatically from the database.
For a dropdown I wrote this:
$SUL("#txteventitleid").val(json[0].eventtitle);
But it is not prefilling from the database.
What is the correct procedure for dropdown?
txteventitleidis a dropdown (select) then it will not work. to fill the select with options you can look at stackoverflow.com/a/1745745/2943218 It's simular but you need to change it just a bittxtwhich indicates it's a textbox, not aselect. 2) exactly what is the ID of the "dropdown"? Your property iseventtitle, but your code ID iseventitleid- looks like it should beeventtitleid(2 Ts in the middle). This is why we ask for minimal code - looks like it's just a typo.<option>s already exist and it is a<select id='eventitleid>then$("#txteventitleid").val(new_value)should work, here's an example: jsfiddle.net/msuedwnc but it won't add new<option>s for you.