php - Form elements are not being POSTed in Opencart module -
i writing own module, using base dummy one. i've completed big part of task, need pass settings. reason added 2 new 'input' elements can see:
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="form"> <div id="hidset" title="configure module" style="display:none;"> <table> <tr><td>apikey:</td><td><input type="text" name="my_module_apikey" value="5"/></td><tr/> <tr><td>user id:</td><td><input type="text" name="my_module_uid" value="6"/></td><tr/> </table> </div>
then wanted div open in dialog box. wrote function it:
function dialogsettings() { $( "#hidset" ).dialog({ height: 250, width: 250, modal: true, buttons: { 'ok': function() { $(this).dialog('close'); } } }); }
till here works expected.
now, if choose open dialog - no matter if change settings or nothing - click on button close , choose save module, these 2 settings not being posted. if choose edit module again , time not open dialog, voila! settings being posted fine hardcoded values.
any idea causing issue? appreciated.
ok, figured out problem. it's because .dialog rearranges dom tree in way these 2 elements considered more part of form, not being posted it. possible solution (maybe hack?) pass dialog field values in hidden inputs inside form, being included in post data.
if have better solution this, please contribute!
Comments
Post a Comment