dform json and validation json

116 views
Skip to first unread message

Himanshu Sonkar

unread,
Dec 2, 2014, 4:54:38 AM12/2/14
to jquery...@googlegroups.com
    <form id="myform"></form>
       
       <script type="text/javascript">
   
            $("#myform").dform({"action":"index.html","method":"get","html":[{"name":"username","caption":"Name","id":"input_Name","type":"text","placeholder":"us...@example.com"},{"name":"password","caption":"password","id":"input_password","type":"password","placeholder":"password"},{"id":"input_gergfe","type":"submit","value":"submit"}]});
           
            $('#myform').validate({"rules":{"input_Name":{"required":true,"maxlength":5},"password":{"required":true,"maxlength": "5"}}});
           
    </script>

I have added jquery.validate.js and jquery.dform-1.1.0.min.js.

will this validate the form  

David Luecke

unread,
Dec 2, 2014, 10:31:31 AM12/2/14
to jquery...@googlegroups.com
I would think so. Did you try it?

--
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.

Himanshu Sonkar

unread,
Dec 3, 2014, 6:28:31 AM12/3/14
to jquery...@googlegroups.com
Yes, it is working.Actually before i have added validation library first and then dform library so it was not working.

Thanks

Himanshu Sonkar

unread,
Feb 16, 2015, 3:50:06 AM2/16/15
to jquery...@googlegroups.com

jquery.dform make radio button input and label one after another.
Please suggest how can I structure JSON to generate this type of html code.

<div id="input_Select" class="form-group">
    <label class="col-sm-3 control-label">Select</label>
    <div class="col-sm-6">
        <div class="radio">
            <label for="radiooption1">
                <input type="radio" value="1" name="input_Select" id="radiooption1">
                option1
            </label>
        </div>
        <div class="radio">
            <label for="radiooption2">
                <input type="radio" value="2" name="input_Select" id="radiooption2">
                option2
            </label>
        </div>
    </div>
</div>

Thank You

David Luecke

unread,
Feb 17, 2015, 11:17:12 AM2/17/15
to jquery...@googlegroups.com
I discussed how to move a radio button or checkbox into the label at https://groups.google.com/forum/#!searchin/jquery-dform/label/jquery-dform/bxDf1kXI3lM/BSgZRpVp2UwJ:

$.dform.subscribe("options", function(options, type) {
    $(this).find('label').each(function() {
        var el = $(this);
        el.prepend(el.prev())
    });
    
    return $(this);
});

Also see this Fiddle: http://jsfiddle.net/cnvLtwnj/2/

--
Reply all
Reply to author
Forward
0 new messages