gplana
asked on
Change text of current selected option on a DropDownCheckList element
Hi.
I have a web application which uses DropDownCheckList element: http://dropdown-check-list.googlecode.com/svn/trunk/doc/dropdownchecklist.html
When user mark a checkbox, a prompt message appears asking for a numer.
How can I concatenate this number just after the text beside the just marked checkbox?
This is a snippet of my code:
Thank you.
I have a web application which uses DropDownCheckList element: http://dropdown-check-list.googlecode.com/svn/trunk/doc/dropdownchecklist.html
When user mark a checkbox, a prompt message appears asking for a numer.
How can I concatenate this number just after the text beside the just marked checkbox?
This is a snippet of my code:
$("#proves").dropdownchecklist({
onItemClick: function(checkbox, selector){
var justChecked = checkbox.prop("checked");
if (justChecked){
num_autoritz_p = prompt("Número d'autorització:","");
if (num_autoritz_p.length>0){
codi_nou = checkbox.val();
a_proves[codi_nou] = num_autoritz_p;
}
else
checkbox.prop("checked",false);
}
else {
codi_nou = checkbox.val();
a_proves[codi_nou] = null;
delete(a_proves[codi_nou]);
}
} // Fi function onItemClick
}); // Fi definició dropdownchecklist
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
1. Is it possible also to remove the num_autoritz_p when user un-mark the checkbox?
2. If user marks the checkbox with the most large text, then the added number goes out of the control: scrollbars appear and number appeared on the page background instead of on the control's background.
Thanks.