Note that there are some explanatory texts on larger screens.

plurals
  1. POrestoring old submit function javascript
    primarykey
    data
    text
    <p>u have a form with input data. like</p> <pre><code>&lt;form id = 'myform'&gt; ... &lt;td&gt;&lt;input type="checkbox" name="supplier_aid" value="on" checked disabled &gt;{$output.t_artikelnr}&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" name="descshort" value="on"&gt;{$output.t_kurztext}&lt;/td&gt; &lt;td&gt;&lt;input type="checkbox" name="buyer_aid" value="on"&gt;{$output.t_sap_materialnr}&lt;/td&gt; ... &lt;/form&gt; </code></pre> <p>on document ready i replace the default submit function with my function (only way, legacy code strikes again...)</p> <pre><code>document.myform.submit = function (){ //do some stuff.. //and eventually return true; } </code></pre> <p>but now no form submit happens... anyone knows how can i restore the submit behavior?</p> <p>here is the whole js </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ document.articlelistform.progress = {}; document.articlelistform.progress.update = function(){ var variables = document.articlelistform.progress; var state = variables.data.done / variables.data.togo; if(document.articlelistform.progress.lock){ variables.bar.updateProgress(state,'{/literal}{$output.m_queue_progress_message_status}{literal}') return; } if(typeof(variables.togo) =='undefined'){ variables.togo = 5; } switch(variables.data.state){ case 'inQue': variables.bar.updateProgress((5 - variables.togo) / 5,'{/literal}{$output.m_queue_progress_message_gathering}{literal}'); variables.togo--; if(variables.togo &lt;= 0) variables.togo = 5; document.articlelistform.submit(variables.data); break; case 'inProcess': if(variables.togo &lt;= 0 || variables.data.update){ variables.togo = 5; variables.bar.updateProgress(state,'{/literal}{$output.m_queue_progress_message_genarating}{literal} '+ variables.data.done + '/' + variables.data.togo); document.articlelistform.submit(variables.data); }else variables.togo--; break; case 'downloadDone': variables.bar.updateProgress(1,'{/literal}{$output.m_queue_progress_message_download}{literal}!'); if(window.location != 'failed'){ window.location = variables.data.location; clearInterval(variables.ticking); delete variables.ticking; variables.togo = 5; variables.state = 'new'; }else{ document.articlelistform.progress.bar.updateProgress(1,'{/literal}{$output.m_queue_progress_message_networkerr}{literal}!'); } break; case 'error' : clearInterval(variables.ticking); delete variables.ticking; variables.togo = 5; variables.state = 'error'; document.articlelistform.progress.bar.updateProgress(1,'{/literal}{$output.m_queue_progress_message_server_error}{literal}'); document.articlelistform.submit(variables.data); break; } } document.articlelistform.submit = function(data){ var settings = document.articlelistform.progress; settings.lock = true; if(typeof(data) == 'undefined') data = {state:'new'}; if(typeof(settings.data) != 'undefined') if(settings.data.state == 'downloadDone'){ window.location = settings.data.location; return false; } if(typeof(data) == 'object') if(data.state == 'error') document.articlelistform.submit() $('#formSettings').val(JSON.stringify(data)); $.ajax({ type: "POST", url: 'ajax-backend/downloadCatalogueProgress.php', data: $(this).serialize() , success: function(data){ settings.lock = false; if(!data.error){ if((data.state == 'inQue' &amp;&amp; typeof(settings.bar) == 'undefined')||data.progress){ delete data.progress; $('#catalogMessageHolder').html(''); settings.bar = new Ext.ProgressBar({ renderTo: 'catalogMessageHolder', value: 0.1, width: 200, maxValue:60, minValue: 0, text : '{/literal}{$output.m_queue_progress_message_genarating}{literal}.' }); settings.data = data; document.articlelistform.progress.ticking = setInterval(settings.update, 1000, data, true); }else{ settings.data = data; } $('#cataloLoaderHolder').show(); }else{ //@todo: implement a warning message } }, failure: function(){ document.articlelistform.progress.bar.updateProgress(1,'{/literal}{$output.m_queue_progress_message_networkerr}{literal}!'); } }); return true; }; }); &lt;/script&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload