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
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to