Postback from within a Facebox

84 views
Skip to first unread message

connor murphy

unread,
Oct 3, 2008, 5:08:11 AM10/3/08
to facebox
I have a simple comments table in Asp.net.
I want to use Facebox for users to enter new comments

The facebox opens fine. Users can enter their name and comment text.
However, when they click submit the postback event does not fire.
I am currently trying to use an Ajax postback so that the comments
table on the parent page gets updated.

Everything works fine when I test the 'AddComments' DIV outside
facebox.

Please advise how I can get around this? Otherwise I will be forced to
abandon Facebox :(

sree

unread,
Oct 10, 2008, 9:50:29 AM10/10/08
to facebox
Hey I am also using FaceBox, Can you please let me know how can
Users can enter their name and comment text.
> However, when they click submit the postback event does not fire. in java

Guzman Braso

unread,
Oct 10, 2008, 10:31:15 AM10/10/08
to fac...@googlegroups.com
I'm using facebox and AjaxForms() to submit the forms inside Facebox.

The only trick I'm usin is that because I got tired of fight to allow
Js code access between facebox & the main document, since then what I
use is something like:

fb = '<my html form><any html I want to show in facebox>' and then
load facebox(fb).

That way works great and works with any plugin . However, as soon you
start needing a lot of html code for your fb window you mess with the
load time of the main document.

To fix that issue what I use is getScript of jquery and place all my
fb='...' and facebox(fb) inside a js file and load it only when the
user clicks the link that needs the facebox window to be open.

Hope this give you some ideas...

Guzman
--
Guzmán Brasó Núñez
Senior Perl Developer / Sysadmin
Web: http://guzman.braso.info
Mobile: +598 98 674020

sree vardhan

unread,
Oct 10, 2008, 12:51:51 PM10/10/08
to fac...@googlegroups.com
Hi

Guzman Braso

Thanks for the mail , I need small favour  , Currently we are using Wicket Technology for UI, Can Youb give me a sample code with Face Box having  a  table with check box and bottom YES or NO button , on clcick of YES or NO button, I should be able to fetch information from facebox and submit it to the main page(main Screen), 


That will be an awsome help If you can Help me with the code , we are Quite new to this Technology ,please provide the necessary help.

Thanks
Ragu.

connor murphy

unread,
Oct 20, 2008, 7:15:19 AM10/20/08
to facebox
Hi Guzman,

Could you post an example? What AjaxForms library are you using? Is it
the Forms plugin for Jquery?
In the code below I want btnAddComment_Click to postback to the ASPX
code behind file. This does not fire when launched withing the
Facebox :(
The postback works as normal when used outside facebox.

Thanks,
Connor

<div id="AddComment" style="display:none" >

<h2>New Comment</h2>
<ol>
<li>
<asp:Label ID="Label1" runat="server"
AssociatedControlID="txtUser">User</asp:Label>
<asp:TextBox Enabled="false" ID="txtUser"
runat="server" Rows="10"></asp:TextBox>
</li>
<li>
<asp:Label ID="Label2" runat="server"
AssociatedControlID="txtDate">Date</asp:Label>
<asp:TextBox Enabled="false" ID="txtDate"
runat="server" Rows="10"></asp:TextBox>
</li>
<li>
<asp:Label ID="Label4" runat="server"
Text="Subject" AssociatedControlID="ddlSubject"></asp:Label>
<asp:DropDownList ID="ddlSubject" runat="server">
<asp:ListItem Text="Owner"></asp:ListItem>
<asp:ListItem Text="Co-Owner"></asp:ListItem>
</asp:DropDownList>
</li>
<li>
<asp:Label ID="lblComment" runat="server"
AssociatedControlID="txtComment"> Comment</asp:Label>
<asp:TextBox TextMode="MultiLine" ID="txtComment"
runat="server" Rows="10"></asp:TextBox>
</li>
<li>
<asp:Label ID="Label3" runat="server"
AssociatedControlID="btnAddComment"> </asp:Label>
<asp:Button ID="btnAddComment" runat="server"
Text="Add Comment"
onclick="btnAddComment_Click" />
</li>
</ol>

</div>

<a href="#AddComment" rel="facebox" class="button">Add Comment</a>
> Mobile: +598 98 674020- Hide quoted text -
>
> - Show quoted text -

connor murphy

unread,
Oct 20, 2008, 7:24:53 AM10/20/08
to facebox
Check out http://stackoverflow.com/questions/162276/jquery-facebox-plugin-get-it-inside-the-form-tag
This worked for me :) Although I'm not sure why?
> > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages