Webpage Form - onsubmit open fancybox lightbox

1,978 views
Skip to first unread message

miss_j2000

unread,
Apr 5, 2012, 6:54:23 AM4/5/12
to fancybox
Hi using Version: 1.3.4

I just need the fancybox lightbox to open on submit within a simple
form

<input type="image" alt="submit" title="submit" src="img/
buttonSubmit.gif" value="" />

Can anyone help me :)

Greatly appreciated

Best regards
Jaimie

cc.emeraldeyes

unread,
Apr 5, 2012, 9:25:25 PM4/5/12
to fancybox
can you not just do something like $("#submitbutton").click(function()
{
$("#something").lightbox()});
?

Jaimie Stow

unread,
Apr 6, 2012, 6:07:42 AM4/6/12
to fanc...@googlegroups.com
HI I really appreciate your response - thank you

But could you send me the code i would add as I am not quite savvy enough

have a great day
best regards
Jaimie

> Date: Thu, 5 Apr 2012 18:25:25 -0700
> Subject: Re: Webpage Form - onsubmit open fancybox lightbox
> From: cc.emer...@gmail.com
> To: fanc...@googlegroups.com
> --
> You received this message because you are subscribed to the Google Groups "fancybox" group.
> To post to this group, send email to fanc...@googlegroups.com.
> To unsubscribe from this group, send email to fancybox+u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/fancybox?hl=en.
>

JFK

unread,
Apr 6, 2012, 7:55:18 PM4/6/12
to fancybox
do you mean that you have a form on your page, and when you submit
such form then it should fire fancybox (with another form inside?) ?
please elaborate

On Apr 6, 3:07 am, Jaimie Stow <miss_j2...@hotmail.com> wrote:
> HI I really appreciate your response - thank you
>
> But could you send me the code i would add as I am not quite savvy enough
>
> have a great day
> best regards
> Jaimie
>
>
>
>
>
>
>
> > Date: Thu, 5 Apr 2012 18:25:25 -0700
> > Subject: Re: Webpage Form - onsubmit open fancybox lightbox
> > From: cc.emeralde...@gmail.com

Jaimie Stow

unread,
Apr 7, 2012, 6:05:42 AM4/7/12
to fanc...@googlegroups.com
Hi again

The submit button is on a web page (not in a fancybox)
Once you click on SUBMIT BUTTON -  a fancybox popup with message inside it opens

cheers again
best regards
Jaimie

> Date: Fri, 6 Apr 2012 16:55:18 -0700

> Subject: Re: Webpage Form - onsubmit open fancybox lightbox

Jaimie Stow

unread,
Apr 8, 2012, 8:47:44 AM4/8/12
to fanc...@googlegroups.com
Hi Just wondering if anyone can help with submit button query


From: miss_...@hotmail.com
To: fanc...@googlegroups.com
Subject: RE: Webpage Form - onsubmit open fancybox lightbox
Date: Sat, 7 Apr 2012 11:05:42 +0100

JFK

unread,
Apr 8, 2012, 5:26:12 PM4/8/12
to fancybox
you still would need an anchor bound to fancybox like
<a class="fancybox" href="{target to msg}"></a>

the add to your "form" tag the attribute onsubmit like

<form onsubmit="jQuery(".fancybox").trigger("click");">
... more form fields here maybe
<input type="image" alt="submit" title="submit" src="img/
buttonSubmit.gif" value="" />
</form>

notice that who handles the submit event is the form tag not the
button (input) tag

On Apr 8, 5:47 am, Jaimie Stow <miss_j2...@hotmail.com> wrote:
> Hi Just wondering if anyone can help with submit button query
>
> From: miss_j2...@hotmail.com
> To: fanc...@googlegroups.com
> Subject: RE: Webpage Form - onsubmit open fancybox lightbox
> Date: Sat, 7 Apr 2012 11:05:42 +0100
>
> Hi again
>
>  The submit button is on a web page (not in a fancybox)
> Once you click on SUBMIT BUTTON -  a fancybox popup with message inside it opens
>
> cheers again
> best regards
> Jaimie
>
>
>
>
>
>
>
>
>
> > Date: Fri, 6 Apr 2012 16:55:18 -0700
> > Subject: Re: Webpage Form - onsubmit open fancybox lightbox
> > From: jfk.d...@gmail.com

Jaimie Stow

unread,
Apr 9, 2012, 8:26:15 AM4/9/12
to fanc...@googlegroups.com

Hi

I added in the extra stuff  but there seems to be a syntax error in the form where this is called

http://gloss-hair.com/old/owl/OWLFORM.html

Not sure what to remove - spent hours trying to call the popup message

the top message is working correctly (Message data) and this is what should popup onSubmit within the form

cheers
J


> Date: Fri, 6 Apr 2012 16:55:18 -0700

> Subject: Re: Webpage Form - onsubmit open fancybox lightbox

Jaimie Stow

unread,
Apr 9, 2012, 12:19:18 PM4/9/12
to fanc...@googlegroups.com
HI
I worked out the syntax and corrected it BUT


http://gloss-hair.com/old/owl/OWLFORM.html

I need only to show the fancybox popup once form is VALIDATED (JQUERY Validate used)

It seems to popup the fancybox popup only when the form is not filled in correctly

Thanks
J

Subject: RE: Webpage Form - onsubmit open fancybox lightbox
Date: Mon, 9 Apr 2012 13:26:15 +0100

Jaimie Stow

unread,
Apr 10, 2012, 4:26:02 AM4/10/12
to fanc...@googlegroups.com
ok
have got the answer for anyone else who needs to reference:

<form id="ie9_competition" method="post">...</form>
Then the call in the function here for validation and once validated fire the submit button to launch FANCYBOX

<script type="text/javascript">
$().ready(function() { // validate the competition form when it is submitted $("#ie9_competition").validate({ errorPlacement: function (error, element) { if ( element.is(":checkbox") ) { error.appendTo( element.closest('div') ); } else { error.insertAfter(element.parent().find("label")); } }, rules: { sEmail: { required: true, email: true }, }, submitHandler: function(form){ jQuery('.fancybox4').trigger('click'); } }); });
</script>

Cheers again for everyones help on this also :)



From: miss_...@hotmail.com
To: fanc...@googlegroups.com
Subject: RE: Webpage Form - onsubmit open fancybox lightbox
Date: Sun, 8 Apr 2012 13:47:44 +0100
Reply all
Reply to author
Forward
0 new messages