Click here to Skip to main content
15,881,709 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to perform the bootstrap validations in asp.net website
help me to solve the problem
thanks in advance for your help
Posted
Comments
ZurdoDev 30-Jul-14 12:57pm    
What's your question?
Omkar Hendre 6-Aug-14 7:50am    
I want to apply the bootstrap validation in my asp.net website project
Omkar Hendre 7-Aug-14 6:28am    
hello?????

 
Share this answer
 
Comments
Omkar Hendre 31-Jul-14 4:57am    
TypeError: $(...).validate is not a function

success: function (element) {


Omkar Hendre 2-Aug-14 9:13am    
I Got the above error please help me
Nirav Prabtani 2-Aug-14 9:22am    
Have you set validate.js regerence in your project??
Omkar Hendre 5-Aug-14 3:20am    
yes sir i set the validate.js in my project
Omkar Hendre 6-Aug-14 7:50am    
nirav sir are you there plzzz help me sir
 
Share this answer
 
Comments
Omkar Hendre 2-Aug-14 9:11am    
Hello is there is anyone who can help me plzzzzzzzz
Here is the code or script for validating controls

<script type="text/javascript">
$(document).ready(function () {
$('input[type = text],input[type = password]').val(''); // not affecting if comment or un-comment
$('#form1').bootstrapValidator({
live: 'disabled',
message: 'This value is not valid',
feedbackIcons: {
//valid: 'fa fa-check',
invalid: 'fa fa-times',
validating: 'fa fa-refresh'
},
fields: {
txt_user_id: {
trigger:'blur',
message: 'The username is not valid',
validators: {
notEmpty: {
message: 'The username is required and cannot be empty'
},
stringLength: {
min: 6,
max: 30,
message: 'The username must be more than 6 and less than 30 characters long'
}
}
},
txt_password: {
trigger: 'blur',
message: 'The password is not valid',
validators: {
notEmpty: {
message: 'The password is required and cannot be empty'
},
stringLength: {
min: 6,
max: 30,
message: 'The password must be more than 6 and less than 30 characters long'
}
}
}
},


});

$('#btn_login').click(function () {
$('#form1').bootstrapValidator('validate');
});

$('#btn_cancel').click(function () {
$('#form1').data('bootstrapValidator').resetForm(true);
});

});
</script>

Here is my form

XML
<form id="form1" method="post" runat="server" class="form-horizontal">
    <div>
    <div class="form-box" id="login-box">
            <div class="header">Sign In</div>
                <asp:Label ID="lbl_msg" runat="server" Text=""></asp:Label>
                <div class="body bg-gray">
                    <div class="form-group">
                        <div class="col-md-12">
                            <asp:TextBox ID="txt_user_id" runat="server" class="form-control" placeholder="User ID" ClientIDMode="Static"></asp:TextBox>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-12">
                            <asp:TextBox ID="txt_password" runat="server" class="form-control" placeholder="Password" TextMode="Password" ClientIDMode="Static"></asp:TextBox>
                        </div>
                    </div>
                </div>
                <div class="footer">
                    <asp:Button ID="btn_login" runat="server" Text="Login" ClientIDMode="Static"
                        class="btn bg-olive btn-sm" onclick="btn_login_Click"/>
                    <asp:Button ID="btn_cancel" runat="server" Text="Cancel" ClientIDMode="Static"
                        class="btn bg-olive btn-sm"/>
                    <p><a href="#">I forgot my password</a><br />
                    <a href="register.aspx">Sign Up</a></p>
                </div>
        </div>
    </div>
    <br />
    </form>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900