[eluser]Matteo[/eluser]
I have a div in my footer called
<div id="pup"></div> within which I populate various helps, forms and other content relevant to the current page through an AJAX call via jQuery. The popup works properly and the AJAX calls direct the appropriate content. My question is how to use the content of the popup as a form that is recognizable by CI.
For example, my index page has a login div for currently-registered users. I also have a link for "Register New Users" that calls the jQuery lightbox (popup) and populates it with the login.php page from
/docs/login.php.
I can't figure out how to write the controller (register) to force the model (m_register) to recognize the AJAX content within the lightbox.
Maybe I'm not thinking this right, but my attempts have been to have the
form_open() and code inside the login.php, but it's not posting to the database. When I remove the login.php from the lightbox and have the "Register" link point to it, all seems to work fine.
Any ideas?
jQuery Code ---
Code:
$("#btnRegister").bind("click", function()
{
$("#pup").bPopup({loadUrl: $(this).attr('href'), fadeSpeed:'fast', modalClose: true, opacity: 0.5});
return false
}
);
My home.php looks like this: --
Code:
<div id="menu_holder"></div>
<div id="contentTop">
<div id="screen">
<!-- PASTE THE CAROUSEL CODE HERE -->
</div>
</div>
<div id="contentBottom">
<div id="bottomLeft">
<h2>Login here...</h2>
<input class="txt_lrg" name="userEmail" type="text" value="Email..." id="user_email" (this.value == '') {this.value = 'Email...'; }"/>
</br>
<input class="txt_lrg" name="userPassword" type="text" value="Password..." id="user_password" (this.value == '') {this.value = 'Password...'; this.type = 'text';}"/>
</br>
<input name="persist" type="checkbox"/>Keep me logged on.
</div>
<div id="bottomRight">
<h2><a id="btnRegister" href="/docs/register.php">Create</a> an account...</h2>
</div>
</div>