Jump to content

Form in a div


marf

Recommended Posts

I am currently wondering how to go about this.  I have lets say  index.php  with all kinds of divs and such. One of the divs, I have load signup.php within the div using XMLHTTPRequest. So that form shows up perfectly fine within my div. However what I'm wondering is, when they fill in the form and click Sign Up, I will of course do the necessary database insertions/confirmation e-mail, and I want it to Load a new page in the Div. What I'm wondering is do I have the <form> in signup.php do a post or get action, and will pressing submit cause the actual loading of a whole new page? because I don't want it to load a new page, I just want it to do the necessary php code and then return a value to the Div saying either (completed) or (error).  Anybody done anything similar to this?

 

Thanks

Link to comment
Share on other sites

make the form tag only hav a method and not an action and have a form name and id, then you have a button instead of a submit, which will have an onclick event that calls a javascript function which will do your processing, and there is no need to do call a new page, the javascript will handle all your requests to the server and the php wil be seperate, and all you need to do there is get the responsetext, and fill the div which had the form with the thank you message received from php

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.