javascript - Validation Twitter Bootstrap with Django -


i using django , twitter bootstrap. using following code validation. add more validations. example if variable django false return 'owner not exist'. tried following not working.

<script type="text/javascript"> var test = {msg_owner|safe} $(document).ready(function() {     $('#frm').bootstrapvalidator({          message: 'this value not valid',         feedbackicons: {             valid: 'glyphicon glyphicon-ok',             invalid: 'glyphicon glyphicon-remove',             validating: 'glyphicon glyphicon-refresh'         },         fields: {             'owner': {                 validators: {                     notempty: {                         message: 'please enter owner'                     }                     test==false: {                         message: 'owner not exist'                     }                 }             }         });     }); </script> 

in server side this:

def test(request):     msg_owner = false     return render_to_response("hello.html", {'msg_owner': msg_owner}) 

try this:

var test = {{msg_owner|safe}}; 

Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -