Jump to content

jQuery plugins


Guest JKPrayJr

Recommended Posts

Guest JKPrayJr

I am hoping people post stuff with questions about all sorts of plugin questions...but I have one right now specifically about DFORM. I need to create documentation about how to use DFORM to create forms...but I am unable to get it to run myself so that is the first battle! I already have an account on Killer Sites University and watched the first 15 Javascript videos hoping to fill in some gaps...all excellent, but I do not have time to watch all 39 and then the AJAX ones and then all the jQuery ones. I see that it creates forms automatically with JS Objects...but I do not see anything on JS objects in the tutorials or JSON, I am not an expert at either, I am learning all of these new technologies actually, so any direction would be awesome as DFORMs site and jQuerys Docs do not have the best documentation on how to implement this plug in. I need to make a "Telephone Note" to show who called their number, etc. Eventually it will need to involve jQuery but I need to know how to use the plugin!

This is the example on jQuery...with no explanation of how to utilize it...

 

 

var formdata =

{

"action" : "index.html",

"method" : "get",

"elements" :

[

{

"name" : "textfield",

"label" : "Label for textfield",

"type" : "text",

"value" : "Hello world"

},

{

"type" : "submit",

"value" : "Say hello"

}

]

};

$("#myform").buildForm(formdata);

 

I know it wont work unless I change some values but when I run this "Firebug's log limit has been reached. 0 entries not shown. Preferences

$ is not defined

[break On This Error] $("#myform").buildForm(formdata); " is what comes up in the debugger. Please point me in the right direction/ or to some resources as I feel like I have been just spinning my wheels the past few days with so much to look up. I am available all weekend and am hoping I can tackle this so I am not put in support next week and stuck testing stuff...Thanks guys, your videos are awesome!- Kevin

 

 

 

jQuery DFORM Doc-

dForm

Link to comment
Share on other sites

You need to include the jQuery script then the dForm script:

 

<script src="path/to/jquery.js" type="text/javascript"></script>
<script src="path/to/dForm.js" type="text/javascript"></script>

 

then you need to create a third <script> tag and wrap your code in a jQuery document ready check:

 

<script type="text/javascript">
jQuery(document).ready(function($){
   var formdata = {
       "action" : "index.html",
       "method" : "get",
       "elements" : [
           {
               "name" : "textfield",
               "label" : "Label for textfield",
               "type" : "text",
               "value" : "Hello world"
           },{
               "type" : "submit",
               "value" : "Say hello"
           }
       ]
   };
   $("#myform").buildForm(formdata);
});
</script>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...