Hi all,
I've got a CMS which currently works quite nicely - but it's ugly and not hugely user friendly - a lot of additional clicking.
I've redesigned it so it's looking much nicer, but I kind of want to avoid having to reload the entire page each time.
Cue: AJAX. I've got the basic AJAX functionality running so that index.php has a link which calls edition_detail.php and places the contents thereof in the div called #content. So far, so good.
What I'm struggling with is the button functionality!
edition_detail.php is essentially a 3 phase page.
1) If you're going to it raw, show a disabled form, displaying all the detail.
2) If a button is clicked (name is 'Edit') it displays the same form, but with the fields editable; and of course there will be a 'Submit' button which takes me on nicely to phase...
3) which is if the form is submitted, it updates the database and displays the data as per phase 1.
Where I'm at:
Displaying the initial form fine.
On clicking 'edit', if I add an onclick httprequest, I can display the 'edit' mode IF I store it in a second php file (say, 'edition_detail_edit.php'. What I can't seem to do is successfully post form data or actions.
From what I've read, I need to use something like jQuery to update the data, but what I can't fathom is how to pass the initial 'edit mode' statement within the 'content' div.
Is it even possible to do what I'm trying to do? Most tutorials I've seen seem to keep referring to a separate file.
I'm rather new to AJAX and very new to jQuery, so if someone could help me through this I'd be terribly grateful! I've been reading and playing with the concepts all day, but the logic of how it works just isn't really kicking in!
Cheers in advance,
Toby