/    Sign up×
Community /Pin to ProfileBookmark

Javascript with php forms

I have a problem with my code. I have this simple ajax code which loads, according the link the user has clicked, the page into the content div. I have a form to which the users can put their information and kinda register. The form is checked with php, that everything written in the form is valid. Now the thank you and the error pages load into a new page, because they are two different php files. How can I get them to load inside the content div as well and not into the new page? Cause there isn’t really any link to those pages, they just go there according to the result of the checkup.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@MrNobodyJan 27.2009 — Generally, you would simply do that with PHP -- requiring a refresh of the entire page. The second best thing is using an IFRAME and just target the IFRAME when submitting the FORM. The final choice is 100% JavaScript using AJAX to pass the formdata to PHP and load the response into the content div.
×

Success!

Help @InTrouble spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...