Stuff
public text v1 · immutable // rexql callbacks
function rexcbRadio_( r, id ) { // convert r to a rexql value
var a;
if ( id == r.other ) {
a = r.checked ? r.answer : '';
} else {
var choices = r.choices;
for ( var i = 0, n = choices.length; i < n; ++i ) {
if ( choices[i].checked ) {
a = choices[i].value;
break; // break since rexql hits us with one id at a time
}
}
}
@@ var type = typeof( a == 'number' ) ? 'Number' : 'String';
@@ return rexql.value( a, type );
}