rgb192
asked on
jquery editInPlace select_options shows repeats if I put the default value first (follow up question)
jquery editInPlace select_options shows repeats if I put the default value first
if $yesOrNo='yes' then
select_options=
yes
yes
no
if $yesOrNo='no' then
select_options=
no
yes
no
without doing
if $yesOrNo='yes'
selectOptions="no:no"
else
selectOptions="yes:yes"
is there a way to eliminate repeats
note: a callback function provided by expert Hielo will
https://www.experts-exchange.com/questions/27857043/jquery-editInPlace-select-options-shows-repeats-if-I-put-the-default-value-first.html
not work in this example because the form is being processed on another page
url: "packages.php",
params: "a=renamepackage&pid=1",
this is the solution provided by Hielo
if $yesOrNo='yes' then
select_options=
yes
yes
no
if $yesOrNo='no' then
select_options=
no
yes
no
without doing
if $yesOrNo='yes'
selectOptions="no:no"
else
selectOptions="yes:yes"
is there a way to eliminate repeats
note: a callback function provided by expert Hielo will
https://www.experts-exchange.com/questions/27857043/jquery-editInPlace-select-options-shows-repeats-if-I-put-the-default-value-first.html
not work in this example because the form is being processed on another page
url: "packages.php",
params: "a=renamepackage&pid=1",
this is the solution provided by Hielo
$savingText="saving....";
$selectOptions="yes,no";
echo '<h3>Value:<span id="yesOrNo">'.$yesOrNo.'</span></h3>';
echo '<script type="text/javascript">
$(document).ready(function(){
$("#yesOrNo").editInPlace({
"saving_text": "'.$savingText.'",
"field_type": "select",
"select_options": "'.$selectOptions.'"
,"callback": function(element_id, selectedValue, originalText) {
return selectedValue;
}
});
});
</script>';
$savingText="saving....";
$selectOptions="yes:yes ,no:no";
echo '<h3>Value:<span id="yesOrNo">'.$yesOrNo.'</span></h3>';
echo '<script type="text/javascript">
$(document).ready(function(){
$("#yesOrNo").editInPlace({
url: "packages.php",
params: "a=renamepackage&pid=1",
saving_text: "'.$savingText.'",
field_type: "select",
select_options: "'.$selectOptions.'"
});
});
</script>';
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I have a follow up question
want user to be given option to change value to a new value
https://www.experts-exchange.com/questions/27858595/want-user-to-be-given-option-to-change-value-to-a-new-value.html