473,624 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

showModalDialog and submit

Hi there,

My original window (A) opens a modal dialog window (B).
In B, you fill out a form and submit it to itself for
processing. When B reloads, it knows that is successfully
processed the form and it suppose to close itself after
returning "1" or "0" to A.

My problem is that B will never close. When I submit it,
it kind of opens a new window and close that one before
return to itself (B).

Here is a code sample:

A
---
function newEntry(){
var sReturn=window. showModalDialog ('b.asp');
alert(sReturn);
}

B
---
<%@LANGUAGE="VB SCRIPT" CODEPAGE="1252" %>
<%
dim bSave

bSave=Request.Q ueryString("sav e")
if bSave="1" then
'process
end if
%>
....
function init(bSave){
if(bSave=='1'){
window.returnVa lue=bSave;
window.close();
}
}
....
<body onLoad="init('< % Response.Write( bSave)%>');">
.....
<form id="b" name="b" action="?save=1 " method="post"
target="_self">
....

Any idea ?
Jul 19 '05 #1
3 17437
I'm team lead on an intranet application that uses lots of modal dialogs,
and I can tell you that "Submit"s don't work. What you have to do is have a
script that concantenates all the values together from the form when the
"submit" button is clicked, assigns that value to a variable and returns it
before closing the window. The hardest part is coordinating what's sent
back and forth, and what's processed.

So, you've got the right idea, with one two many steps. Take a look:
<form>
<!-- various input fields here... -->
<input type=button value="Submit" onClick="submit Button_OnClick" >
<!-- notice: type="button" NOT type="submit" -->
</form>

<script language="javas cript" type="text/javascript">
function submitButton_On Click(){
// the form is never submitted
frm = document.forms[0]
sTemp = 'email=' + frm.email.value
sTemp += "&fname=" + frm.fname.value
sTemp += "&lname=" + frm.lname.value
sTemp += "&open=" + frm.openContact .checked
returnValue = sTemp
window.close()
}

</script>

Hope this helps,

- Wm

"Joel" <jo******@msdn. com> wrote in message
news:08******** *************** *****@phx.gbl.. .
Hi there,

My original window (A) opens a modal dialog window (B).
In B, you fill out a form and submit it to itself for
processing. When B reloads, it knows that is successfully
processed the form and it suppose to close itself after
returning "1" or "0" to A.

My problem is that B will never close. When I submit it,
it kind of opens a new window and close that one before
return to itself (B).

Here is a code sample:

A
---
function newEntry(){
var sReturn=window. showModalDialog ('b.asp');
alert(sReturn);
}

B
---
<%@LANGUAGE="VB SCRIPT" CODEPAGE="1252" %>
<%
dim bSave

bSave=Request.Q ueryString("sav e")
if bSave="1" then
'process
end if
%>
...
function init(bSave){
if(bSave=='1'){
window.returnVa lue=bSave;
window.close();
}
}
...
<body onLoad="init('< % Response.Write( bSave)%>');">
....
<form id="b" name="b" action="?save=1 " method="post"
target="_self">
...

Any idea ?

Jul 19 '05 #2
Put an iframe in the modal dialog and host the form in that.

tim
"Joel" <jo******@msdn. com> wrote in message
news:08******** *************** *****@phx.gbl.. .
Hi there,

My original window (A) opens a modal dialog window (B).
In B, you fill out a form and submit it to itself for
processing. When B reloads, it knows that is successfully
processed the form and it suppose to close itself after
returning "1" or "0" to A.

My problem is that B will never close. When I submit it,
it kind of opens a new window and close that one before
return to itself (B).

Here is a code sample:

A
---
function newEntry(){
var sReturn=window. showModalDialog ('b.asp');
alert(sReturn);
}

B
---
<%@LANGUAGE="VB SCRIPT" CODEPAGE="1252" %>
<%
dim bSave

bSave=Request.Q ueryString("sav e")
if bSave="1" then
'process
end if
%>
...
function init(bSave){
if(bSave=='1'){
window.returnVa lue=bSave;
window.close();
}
}
...
<body onLoad="init('< % Response.Write( bSave)%>');">
....
<form id="b" name="b" action="?save=1 " method="post"
target="_self">
...

Any idea ?

Jul 19 '05 #3
I knew it ! What I've done is that I created an xml tag
inside of my dialog and a function to fill it with my
form's fields and I return the xml string to the caller.

Works fine like this.

Thank You very much.

-----Original Message-----
I'm team lead on an intranet application that uses lots of modal dialogs,and I can tell you that "Submit"s don't work. What you have to do is have ascript that concantenates all the values together from the form when the"submit" button is clicked, assigns that value to a variable and returns itbefore closing the window. The hardest part is coordinating what's sentback and forth, and what's processed.

So, you've got the right idea, with one two many steps. Take a look:<form>
<!-- various input fields here... -->
<input type=button value="Submit" onClick="submit Button_OnClick" > <!-- notice: type="button" NOT type="submit" -->
</form>

<script language="javas cript" type="text/javascript">
function submitButton_On Click(){
// the form is never submitted
frm = document.forms[0]
sTemp = 'email=' + frm.email.value
sTemp += "&fname=" + frm.fname.value
sTemp += "&lname=" + frm.lname.value
sTemp += "&open=" + frm.openContact .checked
returnValue = sTemp
window.close()
}

</script>

Hope this helps,

- Wm

"Joel" <jo******@msdn. com> wrote in message
news:08******* *************** ******@phx.gbl. ..
Hi there,

My original window (A) opens a modal dialog window (B).
In B, you fill out a form and submit it to itself for
processing. When B reloads, it knows that is successfully processed the form and it suppose to close itself after
returning "1" or "0" to A.

My problem is that B will never close. When I submit it, it kind of opens a new window and close that one before
return to itself (B).

Here is a code sample:

A
---
function newEntry(){
var sReturn=window. showModalDialog ('b.asp');
alert(sReturn);
}

B
---
<%@LANGUAGE="VB SCRIPT" CODEPAGE="1252" %>
<%
dim bSave

bSave=Request.Q ueryString("sav e")
if bSave="1" then
'process
end if
%>
...
function init(bSave){
if(bSave=='1'){
window.returnVa lue=bSave;
window.close();
}
}
...
<body onLoad="init('< % Response.Write( bSave)%>');">
....
<form id="b" name="b" action="?save=1 " method="post"
target="_self">
...

Any idea ?

.

Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7827
by: Olan Wilson | last post by:
I have a pretty standard ASP page I want to display in a modal dialog box. The first part of the script is a couple input boxes and a submit button inside of a form with its action property set to the same ASP page and a method of post. The second part is the form handler that inserts the data entered by the user into a database table. The initial HTML form displays just fine in the modal dialog box, but when the user clicks the submit...
0
2182
by: Jinx | last post by:
Windows IE ..NET PROBLEM: After invoking showModalDialog(), a form comes up, the user clicks submit, and a NEW webpage opens. SOLUTION After reading numerous posts that say, paraphrased, "This can't be done, you have to use IFRAMES", I thought I just post a solution.
6
5398
by: Scott Lee | last post by:
I am displaying an ASP.Net generated form in a popup opened with window.showModalDialog. The form contains DropDownList controls. The first ddl is populated via databinding to a datatable, has its AutoPostBack set to true and has its SelectedIndexChanged event being handled in codebehind. The event fires as it should populating two more ddls. The problem is, the two ddls appear empty. I have used a javascript alert to look at the...
3
7220
by: Paul K | last post by:
I'm not quite sure if the problem I'm having is a restriction of showModalDialog or if there is a way around it. The web app I am working requires the user to select a record from a list. I pop this list (generated by a second page) in a second window. When the user selects a record on the datagrid, I close the second window and submit the calling page. If I try to use showModalDialog, the dialog pops up just fine and everything is...
5
3565
by: Tmajarov | last post by:
Haven't been able to find a clear answer to this... I am building an asp.net application and trying to enforce some work flow by displaying a form via the showmodaldialog method. I can get the form to display, etc. But I want to refresh the content of the form displayed in the dialog window without navigating away from the form. For example... the showdialog method opens up a record to be edited. After editing when the save(submit)...
2
2991
by: Sarah | last post by:
I am using the javascript showModalDialog function to open a file upload window. The function opens a page which contains a usercontrol housing the file upload stuff. The control works fine when tested independently, but when called through showModalDialog on submit, another window is opened (a fullsize version of the page passed to showModalDialog). Is this a bug, by design, or have I made some sort of error? thanks
1
2667
by: dan_williams | last post by:
I'm trying to create a textbox control on an asp.net web page, that after a user has typed some text into it, another pop-up window appears with a dropdownlist populated with options related to the text the user entered. My initial attempt was to create a javascript function that executes on the onblur event of my textbox. My javascript function is as follows:- function fnClient() { var tURL = "modGetClient.aspx?client=" +...
4
8361
by: Ralf | last post by:
Here is my scenerio and what I am doing. I am open to other ways of doing this is it makes sense. I have a cell withing a row within a datagrid. When this cell is clicked (its a date field), I want a calendar to pop up to change the date. So, I had to added an onclick event to the cell, which runs a javascript function when it the click happens. The javascript function does the showModalDialog to open the Calendar.aspx page and pass...
0
1263
by: charithstudy | last post by:
Hi All, In ASP.NET , I am using window.showModalDialog method to open a modal window. But when I try to do some processing in the modal window, it opens up another window. Like i have to change password ,iam entering new password and cliks submit button then it opens up a new window and doing process there.i want process to be done in showmodaldialogbox only. because iam opening showmodaldialog in main window, until i close modaldialog...
0
8170
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8675
Oralloy
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...
0
8619
jinu1996
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...
1
8334
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,...
0
8474
tracyyun
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...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
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();...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.