Javascript form submit speed issue

K

korggrok

OK, this makes no sense to me, perhaps someone understands what's
happening. Developing a CGI app. A page contains a table with <th>
header elements and <td> table elements, both if which contain <a href>
links which use OnClick to call javascript to submit a form.

The difference is this: if a click on a <td> element, it calls the
next page immediately. BUT, if I click on a <th> element, the page
will freeze for a long time before calling the next page. The amount
of time this freeze takes depends upon how may rows are in the table!
If there are just a few rows (10 or less), the response is immediate.
If there are a dozen or so, it's a little slower. The more rows in the
table, the slower the response is. I've tried changing the <th>
elements in the header to <td>, so that does not seem to be the reason.

I can't see any reason for this behavior.....no difference between the
two clickable elements....

<th><a href="// Sort descending"
OnClick="sendSortSubmit('4C03','SortView','CCC-CODES.SQL','PO_ORIGIN_REP
desc'); return false;">PO Rep</a>
</th>



The javascript for sendSortSubmit is:

function sendSortSubmit(uni,action,viewname,sortcolumn){
formsort.uni.value = uni;
formsort.action.value = action;
formsort.viewname.value = viewname;
formsort.sortcolumn.value = sortcolumn;
formsort.submit();
return "";
}

<td>
<a href="// Drill-down for JH HARVEY-RESELLER"
OnClick="sendSubmit('4C03','RunView','JH
HARVEY-RESELLER','999999','100','0','0','0','0');return false;">JH
HARVEY-RESELLER</a>
</td>


The javascript for sendSubmit is:

function
sendSubmit(uni,action,CCC,PO_ORIGIN_REP,PO_ORIGIN_SPLIT,DEST_REP,DEST_SPLIT,SPEC_REP,SPEC_SPLIT){
form1.viewname.value = 'TESTVIEW1.SQL' ;
form1.uni.value = uni;
form1.action.value = action;
form1.CCC.value = CCC;
form1.PO_ORIGIN_REP.value = PO_ORIGIN_REP;
form1.PO_ORIGIN_SPLIT.value = PO_ORIGIN_SPLIT;
form1.DEST_REP.value = DEST_REP;
form1.DEST_SPLIT.value = DEST_SPLIT;
form1.SPEC_REP.value = SPEC_REP;
form1.SPEC_SPLIT.value = SPEC_SPLIT;
form1.today.value = getToday();
form1.submit();
return "";
}
 
W

webEater

OK, this makes no sense to me, perhaps someone understands what's
happening. Developing a CGI app. A page contains a table with <th>
header elements and <td> table elements, both if which contain <a href>
links which use OnClick to call javascript to submit a form.

The difference is this: if a click on a <td> element, it calls the
next page immediately. BUT, if I click on a <th> element, the page
will freeze for a long time before calling the next page. The amount
of time this freeze takes depends upon how may rows are in the table!
If there are just a few rows (10 or less), the response is immediate.
If there are a dozen or so, it's a little slower. The more rows in the
table, the slower the response is. I've tried changing the <th>
elements in the header to <td>, so that does not seem to be the reason.

I can't see any reason for this behavior.....no difference between the
two clickable elements....

<th><a href="// Sort descending"
OnClick="sendSortSubmit('4C03','SortView','CCC-CODES.SQL','PO_ORIGIN_REP
desc'); return false;">PO Rep</a>
</th>



The javascript for sendSortSubmit is:

function sendSortSubmit(uni,action,viewname,sortcolumn){
formsort.uni.value = uni;
formsort.action.value = action;
formsort.viewname.value = viewname;
formsort.sortcolumn.value = sortcolumn;
formsort.submit();
return "";
}

<td>
<a href="// Drill-down for JH HARVEY-RESELLER"
OnClick="sendSubmit('4C03','RunView','JH
HARVEY-RESELLER','999999','100','0','0','0','0');return false;">JH
HARVEY-RESELLER</a>
</td>


The javascript for sendSubmit is:

function
sendSubmit(uni,action,CCC,PO_ORIGIN_REP,PO_ORIGIN_SPLIT,DEST_REP,DEST_SPLIT,SPEC_REP,SPEC_SPLIT){
form1.viewname.value = 'TESTVIEW1.SQL' ;
form1.uni.value = uni;
form1.action.value = action;
form1.CCC.value = CCC;
form1.PO_ORIGIN_REP.value = PO_ORIGIN_REP;
form1.PO_ORIGIN_SPLIT.value = PO_ORIGIN_SPLIT;
form1.DEST_REP.value = DEST_REP;
form1.DEST_SPLIT.value = DEST_SPLIT;
form1.SPEC_REP.value = SPEC_REP;
form1.SPEC_SPLIT.value = SPEC_SPLIT;
form1.today.value = getToday();
form1.submit();
return "";
}

Just test to put a # into the href or take
href="javascript:sendSubmit(...);" and leave the onclick event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,147
Messages
2,570,835
Members
47,383
Latest member
EzraGiffor

Latest Threads

Top