Welcome Guest, Not a member yet? Register   Sign In
Trying to not go to a different page after form submit...
#6

(This post was last modified: 01-17-2015, 07:29 PM by dmyers.)

(01-14-2015, 09:43 AM)alexandervj Wrote: I found this ...
http://www.sanwebe.com/2011/12/making-si...ntact-form
I'm gonna go through this but I'm a little unsure what I need to change to make it work with codeigniter instead of just plain php. Any help is appreciated

Sure, Let me try to explain some to you ok?

Of course this line handles the click on the html element with the id="submit_btn"

$("#submit_btn").click...

It then checks that a few required fields are filled in setting "proceed"

Finally if proceed is true it sets "post_data" with the post data and sends it to $.post('contact_me.php',

the contact_me.php page (therefore you would need a controller which handles that).

you then need to send json as your reply

something like this.

$data['type'] = 'error'

echo json_encode($data);

it than stays there and let's you post again.

If you like I can put together a demo which does the validation server side like I explained.

zip it up and post a link here?

Would that help? I don't mind.

dmyers
Reply


Messages In This Thread
RE: Trying to not go to a different page after form submit... - by dmyers - 01-17-2015, 07:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB