简体   繁体   中英

How to validate my form using javascript in docpad

I am trying to use a simple docpad skeleton to set up a form that in turn is validated. I guess this is me not using docpad correctly, as the validation javascript and forms-html is copied from bootstrapValidator .

html-file in my out folder

val.js: pastebin.com/kfg3CKKj

default.html.jade: pastebin.com/kWVAtBEz

When i click the "submit"-button on my form it seems that the page is refreshing, without validation. I've also tried with jquery.validate . Same result.

The problem was that my jquery-selector was wrong.

 $('defaultForm').bootstrapValidator({

should be

 $('#defaultForm')').bootstrapValidator({

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM