Hi. I'm back working on this aspect of things and can't yet get it to work. here is what I have done (slight differences but almost the same).
1) I'm currently trying to apply this to a radiobutton
2) It is in pageview mode
3) The field returns 'addnew' but the label is 'add new'
So what I've done with the above (after many experiments) is:
select 'dbr.javascript', "
function check_if_new(settings, cell)
{
var newval, $select=$(this).find('radiobutton');
if ($select.val()=='addnew') {
newval = prompt('New value?');
if (!newval) {
return false;
}
$select.append($('<option></option>').attr('value',newval).text(newval));
$select.val(newval);
}
return true;
}
";
the the other code to call it is:
SELECT 'dbr.editable', 'Purpose', 'sp_DBR_ai_classify_update', 'inContentID=id', 'type=radiobutton', "select=sp_get_field_values('content_purpose', '')", "options={'autosubmit':1, 'onsubmit':check_if_new, 'display':'inline'}";
Any thing I've missed/got wrong?
Duane