There are 3 buttons on a web page. On clicking each button a same popup window (say window1) opens up. Now there is another button on this popup window (window1), which further opens up to another popup window (say window2). On selecting some value from the 'window2', that value is passed onto the 'window1'. There is a 'Find' link on a 'window1', which calls a javascript function 'clicked()': - <head>
-
<%
-
Dim command
-
command = Request.Form("hid");
-
Response.Write(“Value” & command); -- The value is not printed (Reason found after
-
analysis that may be because the form is not submitted
-
successfully)
-
%>
-
-
function clicked()
-
{
-
document.form.hid.value='FIND';
-
alert("before"); -- This message box appears
-
document.form.submit(); -- after a lot of analysis the conclusion is that
-
this submit statement stops working (as on the status
-
bar 'Opening https:.....File1.asp?form=...' is not
-
displayed when 'after' message box appears
-
alert("after"); -- This message box appears
-
}
-
-
<body.......>
-
<% if command = "FIND" then
-
Response.Write ("Inside Find"); -- This message is not printed.
-
// some functonality
-
-
%>
-
<form ....>
-
-
<input type="hidden" name="hid" value="">
-
-
</form>
-
</body>
This full code works fine on my machine. But this code does not work properly when run on the client-side!, although the same server and the same deployed application is being accessed. There is no particular sequence/scenario but for eg.
When say button1 clicked->window1 opens->window2 is opened->value selected->returned to window1->Clicked on Find-> clicked on Ok->returned on the main page.
Then repeated the same scenario for say 3rd button.
(Till now 'Find' link works fine).
Now repeated the same scenario for 2nd button and here 'after' message is obtained but 'inside Find' is not printed!!
5 4741 gits 5,390
Recognized Expert Moderator Expert
hmmm ... i think i don't get it right ... could you rephrase that question so that it would be a bit more clear ... when is what and how passed between different windows? are those windows real popup windows?
kind regards
What should happen: On clicking 'Find' link some records are retrieved from the database and displayed on the very same popup window. Now further on clicking 'Ok' the popup window closes and all the retrieved records are populated in a list box on the main page (where there were 3 buttons). What happens is: The above scenario does happen once or twice but the 3rd or the 4th time what happens is that on clicking 'Find', no records are retrieved and it goes to wait state. It sort of hangs. None of the links work any further, even the ones on the main page stop working. The window2 also doesn't open, blank page is displayed.
In my first post, in the code, i have added the comments of exactly which all alerts/Response.Write are shown and which are not, when the problem occurs.
Yes it seems the browser does not load, the page does not get refreshed. (When the 1st or the 2nd time 'Find' works fine, the page does get refreshed.)
I can't hit anything on the current session anymore!
After a lot of analysis, we have come to this conclusion that probably 'Find' link does not work after sometime because of some memory/buffer issue. I am using a 'for' loop which concatenates the strings retrieved on clicking 'Find' from the database. -
var concatstr = "";
-
for(i = 0 ; i < arr.length ; i++)
-
{
-
concatstr += arr[i]+";";
-
}
-
parent.opener.mainform.txtbx.value=concatstr; // transferring the semicolon separated string to the main form, where there are the 3 buttons
-
(mainform - is the webpage where there are these 3 buttons.)
(arr - is the array that stores all the retrieved strings from the database on clicking 'Find' link.)
Probably a number of string objects are getting created and filling the buffer. What do u say?
(On an average around 15 strings are retrieved each time)
Probably which is why the 'request' is getting 'blocked'! It goes to wait state.
No other link works as their URL don't work any further (the request is not going through, may be because of the previous pending request [Find link click]), only 'cancel' link works since it has only one statement written : "parent.clo se" (nothing to do with request,respons e).
Is it so that the concatenation described above is creating 15! string objects (read as 15 factorial string objects) and thereby causing the block?
gits 5,390
Recognized Expert Moderator Expert
that small number of string-objects doesn't seem to be an issue that might cause such a problem ... but i cannot see some other obvious thing at the moment. might be to try that all in firefox and have a look at the firebug console might show more info ... i suspect a fatal javascript error that might block the submit then ... it could be a strange return-value that might break the concat-logic or similar ... for example some quotes or double qoutes in the response or something like that?
kind regards
@gits
I will definitely try this out, that you have suggested.
Some more information about the code:
We are opening and closing connection on each opening of the popup window. (opening-closing, opening-closing, opening-closing, .....).
Can this be also an overhead?
I am posting some code portions also for your reference : -
// When Ok button is clicked and the popup window closes after concatenating the string names and ids retrieved. After closing the listbox appears on the main page with the string names retrieved.
-
function clickedOk()
-
{
-
var input1="<select name='myselect' style='width:435;' id='"+btnname+"lboxId' multiple>";
-
-
var input2=new StringBuffer();
-
var concatenated_pooloid = new StringBuffer();
-
var concatenated_poolnames = new StringBuffer();
-
-
for(i=0;i<val.length;i++)
-
{
-
input2=input2.append("<option value='"+ (i+1) +"'>"+ val[i] +"</option>");
-
concatenated_pooloid.append(val[i]+";");
-
concatenated_poolnames.append(val1[i]+";");
-
}
-
-
var btn = "clearbutton"+btnname;
-
var listbox = btnname+"lboxId";
-
var imagebtn = "myIMGOk"+btnname;
-
-
parent.opener.document.getElementById(names_divID).innerHTML = "";
-
parent.opener.document.getElementById(names_divID).innerHTML = parent.opener.document.getElementById(names_divID).innerHTML + " <img id='myIMGOk"+btnname+"' style='color: blue; text-decoration: underline; cursor: pointer;font-family: verdana;font-size: 7pt'
-
src='/images/ok_arrow.gif' border='0' />" +" <a id='clearbutton"+btnname+"' href=java-script:clearListBox('"+btn+"','"+listbox+"','"+names_divID+"','"+const_IDs+"','"+const_NAMES+"','"+imagebtn+"')><u>Clear</u></a>";
-
-
parent.opener.document[const_FORMNAME][const_IDs].value = concatenated_pooloid+";";
-
parent.opener.document[const_FORMNAME][const_NAMES].value = concatenated_poolnames+";";
-
parent.opener.document.getElementById(names_divID).style.display = "inline";
-
-
parent.close();
-
}
-
-
function StringBuffer() {
-
this.buffer = [];
-
}
-
-
StringBuffer.prototype.append = function append(string) {
-
this.buffer.push(string);
-
return this;
-
};
-
-
StringBuffer.prototype.toString = function toString() {
-
return this.buffer.join("");
-
};
-
-
function validateAndSubmit() {
-
document.resourcePickerForm.hidCommand.value = "FIND";
-
document.resourcePickerForm.action = "popupWnd.asp?............"; // ....... means parameters
-
document.resourcePickerForm.submit();
-
}
-
-
<script type="text/java-script">
-
-
// Global Variable Declaration
-
var countTextBox = 0;
-
var tempcount = 0;
-
var totalSelected = 0;
-
-
var selectedArray = new Array();
-
var selectedArray1 = new Array();
-
var count=0;
-
var val = new Array();
-
var val1 = new Array();
-
-
var const_FORMNAME='<%=(Request.QueryString("FormName"))%>';
-
-
-
// This is called after checking the checkboxes displayed with retrieved strings and transferring them on the right-side of the page, the ones which we want to pass on the main page (displayed inside the listbox).
-
function transfer()
-
{
-
// Finding which checkboxes are checked and then adding them.
-
var i=0;
-
while(document.getElementById("chkbox"+i))
-
{
-
if(document.getElementById("chkbox"+i))
-
{
-
if (document.getElementById("chkbox"+i).checked)
-
{
-
var inputTag = document.createElement ("input");
-
var type = "text";
-
inputTag.setAttribute("text",type);
-
inputTag.setAttribute("value",selectedArray[i]);
-
inputTag.setAttribute("name",type+count);
-
inputTag.setAttribute("size",45);
-
inputTag.setAttribute("font-size",8);
-
inputTag.setAttribute("id","strText"+count);
-
val[count]=selectedArray[i]; // Filling names into array val
-
val1[count]=selectedArray1[i]; // Filling ids into array val1
-
-
document.getElementById('RightFrame').innerHTML = document.getElementById('RightFrame').innerHTML + "<br id='br"+count+"'> <input type='checkbox' id='RFchkbox" + count + "' name='RFchkbox" + count + "' visible='true' /> <input type='text' style='font-size:10;font-family:Verdana;' id='strText"+count+"' value='"+selectedArray[i]+"' size='50' readonly='readonly'/>"
-
-
count++;
-
}
-
document.getElementById("chkbox"+i).checked="";
-
}
-
}
-
i++;
-
document.getElementById("C1").checked="";
-
}
-
}
-
-
</script>
-
-
-
<%
-
Dim command
-
command = Request.Form("hidCommand")
-
%>
-
-
<%
-
Sub ChildDisplay(poolOID)
-
-
Set LocalRS = Server.CreateObject("ADODB.RecordSet")
-
strSQL="select name,id,..................."
-
-
LocalRS.Open strSQL, Conn
-
-
If Not LocalRS.EOF Then
-
-
LocalRS.MoveFirst
-
j = 0
-
%>
-
<%
-
Do While LocalRS.EOF <> True
-
%>
-
<tr>
-
<td width="2%" style="border:solid 1px #6c9fc6;border-top:0;">
-
<font size="1" face="Verdana">
-
<input type="checkbox" id="chkbox<%= j %>" name="C2" value="<% = LocalRS.Fields(0).value %>" on-cl-ick='java-script:setSelected("<%=LocalRS.Fields(0).val ue %>", "<% = LocalRS.Fields(2).value %>","<%= j %>")'></font>
-
<input type="hidden" id="PoolId<%= j %>" value="<% = LocalRS.Fields(2).value %>" />
-
</td>
-
<td width="50%" style="border:solid 1px #6c9fc6;border-top:0;border-left:0;" >
-
<font face="Verdana" size="1">
-
<% = LocalRS.Fields(0).value %>
-
</font>
-
</td>
-
</tr>
-
<%
-
j = j + 1
-
LocalRS.MoveNext
-
If LocalRS.EOF = True then
-
exit do
-
end if
-
loop
-
%>
-
<%
-
end if
-
LocalRS.Close
-
Set LocalRS=nothing
-
End Sub
-
%>
-
-
<body style="background-color: #fcfefd">
-
<!-- #include virtual="/config/DataSource.asp" -->
-
<% if command = "FIND" then
-
%>
-
<%
-
Dim Conn ' Connection Variable
-
Dim RS ' Result Set Variable
-
Dim strSQL ' SQL Query String
-
-
Set Conn = Server.CreateObject("ADODB.Connection")
-
Set RS = Server.CreateObject("ADODB.RecordSet")
-
-
locName = Request.Form("location")
-
strSQL = "select name, id from table1 where location ='"+locName+"'"
-
-
Conn.Open SSdsn, SSdbuser, SSdbpass
-
-
RS.Open strSQL, Conn
-
-
If Not RS.EOF Then
-
RS.MoveFirst
-
End If
-
%>
-
<% end if %>
-
-
<form name="popupWndForm" action="" method="post">
-
-
<input type="hidden" id="hidCommand" name="hidCommand" value="" />
-
<a href="java-script:transfer()">Transfer</a>
-
<a href="java-script:validateAndSubmit()">Find</a>
-
<a href="java-script:clickedOk()">OK</a>
-
-
<div class="leftframe">
-
<% if command = "FIND" then
-
%>
-
-
<table id="table1" height="30" cellspacing="0">
-
<!-- MSTableType="nolayout" -->
-
<tr>
-
<td bgcolor="#c2d6e7" style="border:solid 1px #6c9fc6;">
-
<input type="checkbox" name="C1" value="yes" on-cl-ick="java-script:selectDeselectAll()"></td>
-
<td bgcolor="#c2d6e7" style="border:solid 1px #6c9fc6; border-left:0">
-
<b><font face="Verdana" size="1">Name</font></b></td>
-
</tr>
-
<%
-
ChildDisplay(RS.Fields(2))
-
%>
-
</table>
-
-
<% end if %>
-
</div>
-
</form>
-
-
<% if command = "FIND" then
-
%>
-
<%
-
RS.Close
-
Conn.Close
-
Set RS=nothing
-
Set Conn=nothing
-
%>
-
<% end if %>
-
-
</body>
-
</html>
-
Thanks in advance.
The problem is similar to one that is mentioned here:
[url=http://www.justskins.c om/forums/browser-hangs-when-posting-sometimes-85959.html] "If we close the IE window, and start open a new one, then things start loading again. And this is pretty much the only way to get to the web site after this happens, is to restart IE. Any attempts in the original IE window hang." Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Kevin Ingram |
last post by:
Ok, this is probably a silly question but I just keep hitting a brick wall
here.
I usually develop my sites entirely in ASP and use a database for data
storage, works great for me. I also sometimes save information to a text
file on my server like c:\invoices\customername.txt for batch processing
later... I use the FSO commands and it all works slick.
Now, I have a new project: A client wants us to log in to their website on
another...
|
by: Andy Goldstein |
last post by:
I have a table where all the TRs have an onClick handler registered.
One (and only one) of the rows has 2 text input boxes, where each
textbox has an onChange handler registered. Both the onClick and
onChange handlers do some minor manipulation of form data (although
they work on different form elements). If the onChange event fires, I
need the form to be submitted. If the onClick event fires for a TR, I
also need the form to be...
|
by: HD |
last post by:
Hi.
I have an asp page with radio buttons and a combobox... when the user clicks
a radio button, I want the form to submit so I can execute the ASP code in
order to change the list shown in the combobox... I have 2 radiobuttons:
<input type="radio" name="terriprod" value="E">E
<input type="radio" name="terriprod" value="D">D
I have tried adding an OnClick event to each of the radio button...
|
by: threeflush |
last post by:
I'm supporting an ASP legacy application and need to implement
"autosave" functionality. I have two frames, one that holds tabs
displaying different pages a user can select, and the other that holds
the page content itself. If a user clicks on another tab without
clicking the Submit button, I want to submit the current form for them
and do some further processing.
The problem is that top.framename.formname.submit() only works...
|
by: Peloux |
last post by:
Hi,
I have written some htc in order to validate data in a form. most of
htc are attached on 'onblur' event.
Now, we would like to use the Enter Key to sublit form, so we use the
following code :
-----------
<SCRIPT>
function touche_EnterKeyPress(){
| |
by: Piotr Kurpiel |
last post by:
Hi,
I am creating a site where I need to refer to another external file
(aspx).
I create the form and works fine. But as soon as I try to submit the
form automatically (with form.submit()) I get an error from the
external site. I do not have the code of that site but suppose that my
automatic submission does not pass all of the variables. This is how
it looks in plain html:
<form name="Login" method="post"
|
by: Navillus |
last post by:
Hey gang,
I have a login form that is empty by default, but can be filled with
values from a previous form:
<input type=text maxlength="40" size="40" name="user" value="`usr`">
<input type=password maxlength="8" name="password" value="`pss`">
where usr and pss are sent from the previous form.
|
by: gbezas |
last post by:
Hi All,
I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form).
Additionally I have defined the relavant function method in the code for details)
The issue is that when Icall targetForm._submit() method from the newSubmit() function the page I get an 'Object doesn't support this property or method' error
I am using IE...
|
by: annoula |
last post by:
Hello,
I'm sorry if this has come up before but I haven't been able to find a solution in any forum so far.
I have a page with 2 forms. One form contains links that the user clicks to navigate to pages.The other form is the main component of the page. It has radiobuttons and textfields for the user to select/enter input.
The links have actions that I want to fire if the javascrict that I have in the 'onclick' validates. If it doesn't...
|
by: rudiedirkx |
last post by:
Gents,
I have a problem (only in Safari) with the onsubmit in webforms. This topic covers the same subject: http://bytes.com/topic/javascript/answers/166542-onsubmit-safari but not as detailed as I will.
Let me illustrate the problem with examples.
The HTML:
<html>
<head>
<script type="text/javascript" src="/js/mootools_1_11.js"></script>
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |