I use this code:
$('.editable-select-works').editable('https://intra.kiwynet.com/works.asp', {
id: 'pk',
type: "select",
loadurl: 'https://intra.kiwynet.com/works.asp?q_act=READWORKS',
tooltip: 'Select the work',
submit: "OK",
style: "inherit",
placeholder: 'Work',
width: 125
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jeditable.js/2.0.7/jquery.jeditable.min.js"></script>
<span style="display: inline-block;width:250px;" id="572" class="editable-select-works" rrole="button" tabindex="0" title="Select the work">Builder</span><br>
<span style="display: inline-block;width:250px;" id="845" class="editable-select-works" rrole="button" tabindex="0" title="Select the work">Farmer</span><br>
it doesn't work snipped, but you can see it at this address https://intra.kiwynet.com/works.html
the problem is sending the current selected value to works.asp for example ?q_act=READWORKS&q_selected=BLD
for return
{"ART":"Artist","BLD":"Builder","FRM":"Farmer","selected":"BLD"}
I would like to pass the id because so I can see what is written in the db. Or is there some other way?
I tested value: but without success, i tried to insert a function in loadurl: but it is not supported apparently
any idea? Thank you for any help
Read more here: https://stackoverflow.com/questions/66456288/jquery-editable-select-default-value-by-current-value-selected
Content Attribution
This content was originally published by ste at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.