jQuery dForm from a db

128 views
Skip to first unread message

wolfnbasti

unread,
Aug 1, 2014, 6:12:39 PM8/1/14
to jquery...@googlegroups.com
If I have something like this: 
var whatever= {'"type"' : "p",'"caption"' : "Client: ",'"html"':clientName };

How would I pass var whatever into dform? Sort of like this:

       $("#myform").dform({
            "action" : "page.html",
            "method" : "get",
            "html" :
            [
                {
                        whatever
                }
            ]
        });

And then generate a form with something like this (assuming clientName = John):

Client: John

Essentially, I am pulling a bunch of data from a mysql db into arrays that I then populate into a form. For example, I have a form that lists first and last name and address. And if I add another field in the db for phone number I want the form to automatically start displaying the phone field  without having to edit the form. So, I'm trying to get dform to auto generate the form based on what I pull from the db.

Thanks. 

David Luecke

unread,
Aug 2, 2014, 1:23:42 PM8/2/14
to jquery...@googlegroups.com
What exactly is the question? You should be able to easily generate a data structure on the server and then convert it to JSON. Could you somehow fork a Fiddle from http://jsfiddle.net/Daff/Zt4Rz/ to illustrate what you want to do?


--
You received this message because you are subscribed to the Google Groups "jQuery dForm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jquery-dform...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages