Niphold , i tried alot but i am not getting my required result, would you
like to do it for me by using AJAX.
plz modify my code where ever it needed to be.
 on post i want to submit the form and on success call back i need
fancybox, where fancybox URL is default_group_select.
Thanks in advance.



MY HTML +JS
{{extend 'layout.html'}}


<script type="text/javascript">


    $(document).ready(function(){



        $('#button-close-admission').fancybox({
        'hideOnOverlayClick' : false,
        'enableEscapeButton' : false,
        'showCloseButton'     : false,
        'overlayShow'         : true,
            'scrolling'        : 'no'

    });


    });


</script>

<form name="SubmitForm" action="" method="post">

    <h3>Groups for facility {{=facilityName}}</h3>
    <div id="checks">
        {{for row in all_groups:}}
            <div class="checkbox">
                <input type="checkbox" value="{{=row.id}}" id="group_{{=
row.id}}" name="group_{{=row.id}}"
                {{ if row.id in selected_groups:}} checked {{pass}} />
                {{=row.name}}
            </div>
        {{pass}}






    </div>


    <li id="last">


     <input type="button" name="submitId" id="submitId" value="Submit"
onClick="$('#button-close-admission').trigger('click');" />

    <a href="{{=URL('facility_group_edit', 'default_group_select')}}"
id="button-close-admission"></a>



    </li>
</form>


Best Regards,

Waqas Iqbal | Associate Software Engineer

[image: Inline image 1] <http://www.knysys.com/>

W +92-21-34972358 | M +92-342-3146972

Gtalk: waqasiqbal.knysys| wiq...@knysys.com <jk...@knysys.com>**

www.knysys.com | www.knyapps.com


On Tue, Feb 26, 2013 at 3:40 AM, Niphlod <niph...@gmail.com> wrote:

> that's a javascript issue: you're trying to submit the form in the
> standard way, so the page POSTs the values, the page gets refreshed - as a
> normal form submission does - and your "afterwards-attached" fancybox
> doesn't have the chance to show up.
> You need to post the form using ajax
>
>
> On Tuesday, February 26, 2013 7:49:00 AM UTC+1, waqasiqb...@gmail.comwrote:
>>
>> Hi,
>> I have a question regarding multiple events on single click of button , i
>> want to submit my form and also popup the fancybox by clicking a simple
>> button ,
>> here i have my code....
>> *MY Button in HTML*
>> <a href="{{=URL('facility_group_**edit', 'default_group_select')}}"
>> onclick="javascript:**SubmitFancy()" 
>> id="button-close-admission"><**button>Select
>> Default Group</button></a>*
>> *
>> *MY JS*
>> script type="text/javascript">
>> $(document).ready(function(){
>> function SubmitFancy(){
>> document.SubmitForm.submit();
>> $('#button-close-admission').**fancybox({
>> 'overlayShow': true,
>> 'scrolling': 'no'
>> });
>> }
>>  });
>> </script>
>> This form is actually just updating database that means its submitting my
>> data in databases, but after that fancybox is not appearing.
>> i hope my question is clear enough in addition i can also provide my *.py
>> *code as well.
>> Thanks
>> Waqas Iqbal
>>
>  --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


<<image.png>>

Reply via email to