Open days4 opened 8 years ago
hi, i am making a custom form in my drupalgap application there is a field of type radio button .On accessing this form radio button is displaying undefined.Code for that form is shown below
function mymodule_custom_form(form, form_state) { try { form.elements['bet_amount'] = { type: 'textfield', title: 'Amount to bet', required: true }; form.elements['selected_outcome'] = { title: 'Selected Outcome', type: 'radios', options: { 0: 'Rock and Roll', 1: 'Metal' }, default_value:1 }; form.elements['node_id'] = { type: 'hidden', default_value: '', required: true }; form.elements['user_id'] = { type: 'hidden', default_value: '', required: true }; form.elements['submit'] = { type: 'submit', value: 'Say Hello' }; return form; } catch (error) { console.log('mymodule_custom_form - ' + error); } } function mymodule_menu() { try { var items = {}; items['my_form'] = { title: 'Place Bet Form', page_callback: 'drupalgap_get_form', page_arguments: ['mymodule_custom_form'] }; return items; } catch (error) { console.log('mymodule_menu - ' + error); } }
@days4 works for me on the latest of everything:
Watch your JS console log in your browser's developer tools, it may reveal some JS error(s) related to this.
hi, i am making a custom form in my drupalgap application there is a field of type radio button .On accessing this form radio button is displaying undefined.Code for that form is shown below