Javascript? PHP? AJAX? What should I use here?

I am creating a holiday e-card. On the top there is the e-card, and the message from the sender below it. I would like to be able to preview this text while it's being typed in the form below.(on the same page)

Basically, I want to see the same text I'm typing update the message above (in a different style, of course) in with the ecard above as a preview of what it will look like to the recipient.
 
Well, you'll need Ajax for that. PHP is server scripting, which means that it is not your visitors browser interpreting it, it is the server. This means that the page was made with php, and then sent as a complete page to your user.

JavaScript is the action on the browser. It can do stuff while the visitor is on the page.

Ajax sort of gives you an in between. Some aspects of JavaScript require communication with the server, and normally any communication with the server is a total page refresh. If you want your typing to be copied from one spot on the page as you do it, it is Ajax that you want.

On the source link below you can see it doing exactly what you want. Follow through that tutorial and you should be able to put something together without really knowing to much JavaScript or Ajax.
 
Back
Top