views:

43

answers:

3

I want to create a javascript popup box that contains text fields. I want to be able to style this box - using CSS - and I want the textfield entries to be Inserted into a MySQL database. Is this possible?

I would be familiar with doing this through web forms and server side scripting but I need it to be a bit more client side this time to make things seem a bit faster. I am thinking I may need to learn some AJAX but any pointers would be a help.

GF

A: 

You can't connect to a database with client-side javascript. Ajax will help you make seamless calls back to the server without refreshing pages, but you will need to have a server side component to return something useful back to your javascript.

As far as styling your forms with CSS, that part is doable.

Jage
A: 

Best way to do this would be to "popup" a new window which points to a file with the AJAX calls, the form, and the styling.

Josh K
+1  A: 

You don't need to learn that much Javascript, to be completely honest. You could simply create a small HTML form on your page, and display it as a popup. You could either have it send the data to your server-side script via the form's natural submit, or you could pass that information asynchronously.

jQueryUI has an example of something very similar: http://jqueryui.com/demos/dialog/#modal-form

Jonathan Sampson
I've been using ui with ajax driven dialogs to handle several things and i would recommend it. The downside is the ui + jquery size.
Ben
@omfgroflmao: I agree, the size is somewhat of an issue. Keep in mind that you can build a custom download though - http://jqueryui.com/download
Jonathan Sampson