Welcome Guest, Not a member yet? Register   Sign In
Forms inside lightboxes in CI...
#1

[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">
   &lt;!-- PASTE THE CAROUSEL CODE HERE  --&gt;
  </div>
</div>
<div id="contentBottom">
  <div id="bottomLeft">
   <h2>Login here...</h2>
   &lt;input class="txt_lrg" name="userEmail" type="text" value="Email..." id="user_email" (this.value == '') {this.value = 'Email...'; }"/&gt;
   </br>
   &lt;input class="txt_lrg" name="userPassword" type="text" value="Password..." id="user_password" (this.value == '') {this.value = 'Password...'; this.type = 'text';}"/&gt;
   </br>
   &lt;input name="persist" type="checkbox"/&gt;Keep me logged on.
  </div>
  <div id="bottomRight">
   <h2><a id="btnRegister" href="/docs/register.php">Create</a> an account...</h2>
  </div>
  
  
</div>




Theme © iAndrew 2016 - Forum software by © MyBB