<\/div>\"; jQuery('#submit').before(to_insert); } } function submit_form(e){ // debugging helper //alert(Form.serialize($('iform'))); if(jQuery('#inputerrors')) jQuery('#inputerrors').html('
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(jQuery('#submit').prop('keydown')) { jQuery('#submit').keydown(); jQuery('#submit').css('visibility','hidden'); } if(jQuery('#cancelbutton')) jQuery('#cancelbutton').css('visibility','hidden'); jQuery('#loading').css('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(jQuery('#submit')) jQuery('#submit').css('visibility','visible'); if(jQuery('#cancelbutton')) jQuery('#cancelbutton').css('visibility','visible'); if(jQuery('#loading')) jQuery('#loading').css('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(jQuery('#submit')) jQuery('#submit').css('visibility','visible'); if(jQuery('#cancelbutton')) jQuery('#cancelbutton').css('visibility','visible'); if(jQuery('#loading')) jQuery('#loading').css('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>
'; jQuery('#inputerrors').html(message_html); NiftyCheck(); Rounded(\"div#redbox\",\"all\",\"#FFF\",\"#990000\",\"smooth\"); Rounded(\"td#blackbox\",\"all\",\"#FFF\",\"#000000\",\"smooth\"); if(jQuery('#submit')) jQuery('#submit').css('visibility','visible'); if(jQuery('#cancelbutton')) jQuery('#cancelbutton').css('visibility','visible'); if(jQuery('#loading')) jQuery('#loading').css('visibility','hidden'); if(jQuery('#inputerrors')) window.scrollTo(0, 0); } "; return $headjs; } ?>