Morgan
asked on
Modal window with submit button, want to stay on same page after submit clicked
I have a modal window for a complaint form. Validation is done with JS. If all is good the form is then emailed to me.
Everything works great, but I would just like the modal window to close after the submit button is pressed leaving the user on the support page. However, right now after a user clicks on the submit button they are redirected to the php file that handles the email.
You can see what i'm talking about at www.totaleeyoustore.com/support - just click on submit complaint.
I would assume there is a way to do this.
Thanks,
neo
Everything works great, but I would just like the modal window to close after the submit button is pressed leaving the user on the support page. However, right now after a user clicks on the submit button they are redirected to the php file that handles the email.
You can see what i'm talking about at www.totaleeyoustore.com/support - just click on submit complaint.
I would assume there is a way to do this.
Thanks,
neo
ASKER
The modal window is to display a complaint form, which can be seen at the site listed in my original post.
It should close out when the user fills out all forms and clicks the submit button, or when they click the close button. Both work, however when they click on the submit button it redirects them to the from action="http://www.totaleeyoustore.com/themes/totaleeyoustore/components/script/complaint_script.php"
I don't want the redirect. I just want the forms to be submited and emailed to me via the compalint_script.php and the modal window to close, leaving the user at the support page.
It should close out when the user fills out all forms and clicks the submit button, or when they click the close button. Both work, however when they click on the submit button it redirects them to the from action="http://www.totaleeyoustore.com/themes/totaleeyoustore/components/script/complaint_script.php"
I don't want the redirect. I just want the forms to be submited and emailed to me via the compalint_script.php and the modal window to close, leaving the user at the support page.
my suggestion is t use iframe or ajax div to do same.
In case you want to use a modal div, the server should the modal window to close after done processing.
In case you want to use a modal div, the server should the modal window to close after done processing.
my suggestion is t use iframe or ajax div to do same.
In case you want to use a modal dialog, the server should tell the modal window to close after done processing.
In case you want to use a modal dialog, the server should tell the modal window to close after done processing.
ASKER
How do I have the server close it out?
Ajax is an option however, I don't know anything about ajax :(
Ajax is an option however, I don't know anything about ajax :(
This is in the COldfusion zone, so I assume CF is an option. Using CFFORM, the modal window will automatically submit asynchronously rather than submitting the entire page. Once the action has been processed just use the ColdFusion js function hideWindow() to close the model window. So, just two easy steps with Coldfusion, CFFORM and a js function to hide the model.
ASKER
Gdrmaria:
Thank you for the reply. Where do I apply the hidewindow function?
Thank you for the reply. Where do I apply the hidewindow function?
ASKER
...coldfusion??? I swore I selected PHP...
Is there a way to change zones?
Is there a way to change zones?
Your Zones Are:
Zones: Cold Fusion Markup Language, PHP Scripting Language, JavaScript
Click Request attention if you want to remove it from CF...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
see dont panic,
go with my solution. In the modal window/submit action page after processing is over just call the javascript from php. refer this:
http://forums.devshed.com/javascript-development-115/calling-javascript-function-from-php-4718.html
inside javascipti tag execute statement :
window.close();
go with my solution. In the modal window/submit action page after processing is over just call the javascript from php. refer this:
http://forums.devshed.com/javascript-development-115/calling-javascript-function-from-php-4718.html
inside javascipti tag execute statement :
window.close();
ASKER
Maverick Cool:
Unfortently that did not work, or if it did I did not know as I was being redirected to the php email script...the whole page was blank.
maestropsm:
that worked I appreciate it! Thank you.
Unfortently that did not work, or if it did I did not know as I was being redirected to the php email script...the whole page was blank.
maestropsm:
that worked I appreciate it! Thank you.
neonate
In response to the question regarding the re-display of the complaint form after its been submitted.
Can you open another question and I'll see if I can figure that one out.
I don't see, in the code you put in the other support question, anything regarding the method you are using to hide the complain form modal window. I see the code for displaying it but what is the function you are using to close the modal window when you submit that form?
That's where the problem appears to be happening - I suspect you are hiding more div tags than you are displaying when you click the function to open the modal window. It's probably a function being fired in the email form once the email is submitted.
In response to the question regarding the re-display of the complaint form after its been submitted.
Can you open another question and I'll see if I can figure that one out.
I don't see, in the code you put in the other support question, anything regarding the method you are using to hide the complain form modal window. I see the code for displaying it but what is the function you are using to close the modal window when you submit that form?
That's where the problem appears to be happening - I suspect you are hiding more div tags than you are displaying when you click the function to open the modal window. It's probably a function being fired in the email form once the email is submitted.
ASKER
yeah posting a new on now. called "modal window when submit, will not reopen"
ASKER
Maestropsm:
You are right I was hiding the wrong div. I fixed it as outlined in the question "modal window when submit, will not reopen"
If able post a response in there and I'll award you the points as you pointed me in the right direction.
Thanks,
neo
You are right I was hiding the wrong div. I fixed it as outlined in the question "modal window when submit, will not reopen"
If able post a response in there and I'll award you the points as you pointed me in the right direction.
Thanks,
neo
why u need the modal window and when it should get closed. whats purpose this modal window.
If it requires functionality , can't you use ajax.