shadowbox from a submit button form

4 messages Options
Embed this post
Permalink
billiejoe

shadowbox from a submit button form

Reply Threaded More More options
Print post
Permalink
Hello guys!

I want to open a shadowbox window once the user click on submit button in one form. Is this possible? How can I do it?

Thanks!
Wizzud

Re: shadowbox from a submit button form

Reply Threaded More More options
Print post
Permalink
Opening "a shadowbox window" when the user clicks on a submit button is simple. but only if you are not actually submitting the form!
However, I suspect that what you really want to do is submit the form into the newly opened shadowbox window? That is, the main page submits the form, but the result of the submittal (the action) returns into a shadowbox iframe without changing the main page?

This is not so simple, and the best way is to submit the form via ajax, load the returned result into a hidden inline div, then open an inline shadowbox displaying that div.
(Tip : use a library, such as jQuery)
Combine literacy with curiosity and a whole world of information opens up to you
billiejoe

Re: shadowbox from a submit button form

Reply Threaded More More options
Print post
Permalink
well, in other forum someone tell me to try something different, but still isn't working.

<script>
function sendform()
{
document.forms['name_form'].submit();
}
</script>

-----------------------------------------------

<form name="name_form" action="http://www.example.com/">

Teste: <input type="text" value="test_field" size="20">

Enviar

</form>

-------------------------------------------------

This code, in fact, opens a shadowbox window, but in background it loads de action page. When it finishes the browser goes to this page, closing the shadowbox and the previous page. If there is some way to stops the "_parent" page to load it it may work.

Thanks for your help anyway! ;-)


LeviWilcox

Re: shadowbox from a submit button form

Reply Threaded More More options
Print post
Permalink
In reply to this post by Wizzud
Wizzud wrote:
This is not so simple, and the best way is to submit the form via ajax, load the returned result into a hidden inline div, then open an inline shadowbox displaying that div.
(Tip : use a library, such as jQuery)
This is exactly what I'm trying to accomplish, but I'm afraid my ajax/ JQuery knowledge is next to nothing. Is there a nice tutorial you could recommend to accomplish returning form results into a shadowbox window?

thanks ahead of time!