info-F3mW5S/pqWZeoWH0uzbU5w@public.gmane.org
2006-Mar-31 08:10 UTC
info about default value of InPlaceCollectionEditor
I have the follow code:
-------------------------------------
<script type="text/javascript">
function setupCategoryEditor(el, url, id_pagam) {
var Element = document.getElementById(el);
var editor= new Ajax.InPlaceCollectionEditor(el, url,
{
callback: function(form, value) { return
''op=pag_sca&value=''+value+''&id=''+id_pagam+''&id_cliente=8&id_order=22''
},
onBlur: function(request) {Element.show(''indicator'')},
collection: [[0,''No''],[1,''Yes'']],
value: 0,
ajaxOptions: {method: ''get''}
});
}
</script>
-------------------------------------
<div id="p_s_35" align="center">No</div>
<script type="text/javascript">
setupCategoryEditor(''p_s_35'',
''save_pagam_sca.php'', 35);
</script>
-------------------------------------
I have a trouble about default value.
In the DIV p_s_35 I can see "Yes" or "No" and I
haven''t know how to setup
a default value to 0 for "No" and to 1 for "Yes".
I have think a code like:
value: function() {
return ($(el).innerHTML==''Yes'') ? ''1'' :
''0'';
},
but don''t run.
Can you help me?
Exchuse me for my very bad english :-P
Antonello
