Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

Robert Walker
Robert Walker
17,146 Points

PHP JavaScript register form help

I have a sign up form and I am struggling on how to best implement it due to AJAX and fallbacks.

I want to use AJAX to tell a user if the username or email they are trying to use is available. I also want to use AJAX to send the form data to a sign up script and then return either a error message or success message,

The problem I have is im not sure how this will all work if someone doesn't have JavaScript enabled and what happens if they don't.

Retagging your post as JavaScript so people can find it better. :)

1 Answer

create a non-ajax solution so that on submit it goes to a processing page which sends it back to the form in case of errors

then create an ajax solution that intercept the submit events and does it using ajax.

this way your problem is solved.