<\/div>\"; new Insertion.Before('submit', to_insert); } } function submit_form(e){ // debugging helper //alert(Form.serialize($('iform'))); if($('inputerrors')) $('inputerrors').innerHTML = '
Loading...
'; /* dsh: Introduced because pkg_edit tries to set some hidden fields * if executing submit's onclick event. The click gets deleted * by Ajax. Hence using onkeydown instead. */ if($('submit') && $('submit').onkeydown) $('submit').onkeydown(); if($('submit')) $('submit').style.visibility = 'hidden'; if($('cancelbutton')) $('cancelbutton').style.visibility = 'hidden'; $('loading').style.visibility = 'visible'; // submit the form using Ajax } function formSubmitted(resp) { var responseText = resp.responseText; // debugging helper // alert(responseText); if(responseText.indexOf('html') > 0) { /* somehow we have been fed an html page! */ //alert('Somehow we have been fed an html page! Forwarding to /.'); document.location.href = '/'; } eval(responseText); } /* this function will be called if an HTTP error will be triggered */ function formFailure(resp) { showajaxmessage(resp.responseText); if($('submit')) $('submit').style.visibility = 'visible'; if($('cancelbutton')) $('cancelbutton').style.visibility = 'visible'; if($('loading')) $('loading').style.visibility = 'hidden'; } function showajaxmessage(message) { var message_html; if (message == '') { NiftyCheck(); Rounded(\"div#redbox\",\"all\",\"#FFF\",\"#990000\",\"smooth\"); Rounded(\"td#blackbox\",\"all\",\"#FFF\",\"#000000\",\"smooth\"); if($('submit')) $('submit').style.visibility = 'visible'; if($('cancelbutton')) $('cancelbutton').style.visibility = 'visible'; if($('loading')) $('loading').style.visibility = 'hidden'; return; } message_html = '
'; message_html += '
'; message_html += '
'; message_html += ''; message_html += '<\/td>'; message_html += '' + message + '<\/b><\/font><\/td>'; if(message.indexOf('apply') > 0) { message_html += ''; message_html += ''; message_html += '<\/td>'; } message_html += '<\/tr><\/table><\/div><\/td><\/table>
'; $('inputerrors').innerHTML = message_html; NiftyCheck(); Rounded(\"div#redbox\",\"all\",\"#FFF\",\"#990000\",\"smooth\"); Rounded(\"td#blackbox\",\"all\",\"#FFF\",\"#000000\",\"smooth\"); if($('submit')) $('submit').style.visibility = 'visible'; if($('cancelbutton')) $('cancelbutton').style.visibility = 'visible'; if($('loading')) $('loading').style.visibility = 'hidden'; if($('inputerrors')) window.scrollTo(0, 0); } "; return $headjs; } ?>