473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Submit not returning to the server

I am having a weird problem. I have an application thats default.aspx
page is a menu page when a menu item is selected the requested page is
loaded into default.aspx using iframes. When unsaved changes have been
made to the iframe page and a user selects another item from the
default.aspx menu I want to prompt the user to see if they want to
save changes before going to the selected page.
The problem I am having is that the client form submit call is not
causing the server to be called - unless I put a message box after the
submit. I don't need this message box here but if I remove it the
iframe changes to the selected page without saving the change even if
the use selected to save changes.
Here is the code I am using:
Default.aspx - Client Code
Function MenuHome() 'note this function is called by the onclick event
of the menu item
Dim sSource
sSource = "home.aspx?" & _
"ContactId=" & mlContactId & _
"&FirstName=" & msContactFirstName & _
"&LastName=" & msContactLastName & _
"&UserLevel=" & miUserLevel & _
"&NetUserId=" & msNetUserId & _
"&UserType=" & msUserType

If mbDirty Then
'save changes first before proceeding to selected menu
If InStr(1, iframe.location, "ActionStep.aspx") > 0 Then
iMsgboxResult = MsgBox(PENDING_CHANGES, vbYesNoCancel +
vbQuestion, "Action Step")
If iMsgboxResult = vbYes Then
'call the savechanges of the loaded page
iframe.SaveChanges
MenuClick(sSource)
ElseIf iMsgboxResult = vbNo Then
MenuClick(sSource)
ElseIf imsgboxresult = vbCancel Then
'do nothing
End If
Else
MenuClick(sSource)
End If
Else
'go the selected menu
MenuClick(sSource)
End if
End Function

Function MenuClick(sDest)
f.src = sDest
End If
End Function
Iframe page -Client Code
Function SaveChanges()
document.frmActionStep.action = document.frmActionStep.action &
"&Save=Y"
document.frmActionStep.submit
msgbox "Temp Saved" 'note this is what makes it work ??? or calling
document.frmActionStep.submit multiple times ???
End Function
Iframe page - Server Code
Page_Load
If Request.QueryString("Save") = "Y" Then
miSaveSuccess = IIf(SaveRecord(), 1, 0) 'note SaveRecord is the
function that actually saves the changes to the database.
Return
End If

Any help would be greatly appreciated.
Thanks in advance,
Deidre
Jul 21 '05 #1
1 1355
I adding this after the submit and it fixed the problem:
start = timer : while timer-start < .2 : wend
I tried several other things but this was the only thing that seemed to work.
Deidre
Jul 21 '05 #2

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

Similar topics

6
by: Martin Herrman | last post by:
Dear scripters, I wrote a PHP script that produces a form. If the form is submitted, the entered information is checked. If an error in the input is found, a message appears. Using the browser's...
5
by: LevaOpaki | last post by:
Why this work? <a href="#" onClick="Forma1.reset()">Link1</a> and this not? <a href="#" onClick="Forma1.submit()">Link1</a> I get error.
4
by: Sarah | last post by:
Hi all. I have a form, and several text and image links on it that should submit the form with different actions. I prepared a simple page with just the code that's not working. PROBLEM:...
3
by: arpita | last post by:
hi all... is there a way to call a backend application on the onclick event of a submit button?.... thank you....
29
by: Mic | last post by:
Goal: delay execution of form submit Code (Javascript + JScript ASP): <% Response.Write("<OBJECT ID='IntraLaunch' STYLE='display : none' WIDTH=0 HEIGHT=0...
3
by: Matt | last post by:
When the user click the submit button in myform.asp, then it will invoke the javascript to check the form data. I want to know if we need document.myform.submit(); ?? Because even I comment it...
2
by: Margaret Werdermann | last post by:
Hi all: I'm having a nasty time with a particularly difficult piece of code and was hoping someone might be able to help me. I have a FormMail form that originally worked perfectly. Then, I...
7
by: bill | last post by:
Is there any way to make a link (as marked by an <A>-tag, that is), behave exactly like a submit button? Many thanks! -bill
1
by: Deidre | last post by:
I am having a weird problem. I have an application thats default.aspx page is a menu page when a menu item is selected the requested page is loaded into default.aspx using iframes. When unsaved...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.