2017-09-19 5 views
0

フォームを優先する作業を行っていますが、フォームを別のフォームに分割したときに発生するエラーを特定できません。divsフォームが単一のdiv内にネストされている場合は、問題なく送信されます。しかし、div重いコードで送信しようとすると、送信ボタンは何もしません。異なるdivに入力を区切るときに玉フォームが送信されない

ここで壊れたコードです:

.container 
    h5.panel-title Candidate Details 
    hr 
    form.form-group.input-group-sm(method='POST' action='') 
    .row 
     .col-sm-4 
     label.form(for='name') Name 
      input#name.form-control(type='text', placeholder='John Smith...' name='name' required='true' value=(undefined===candidate ? '' : candidate.name)) 
     .col-sm-4 
     label.form(for='signed_offer_letter') Signed Offer Letter:  
      input(type='checkbox', name='signed_offer_letter', checked=(undefined===candidate || candidate.signed_offer_letter!= true ? false:true)) 
    .form-group(style='padding-top:10px') 
     button.btn.btn-sm(type='submit') Update // Nothing happens on submit. 

そして、それは何の価値がある場合は、ここだけで正常に動作し、プリdivのコードは次のとおりです。

.container 
    h5.panel-title Candidate Details 
    hr 
    form.form-group.input-group-sm(method='POST' action='') 
     label.form(for='name') Name 
     input#name.form-control.input-sm(type='text', placeholder='John Smith...' name='name' required='true' value=(undefined===candidate ? '' : candidate.name)) 
     label.form(for='signed_offer_letter') Signed Offer Letter:  
     input(type='checkbox', name='signed_offer_letter', checked=(undefined===candidate || candidate.signed_offer_letter!= true ? false:true)) 

     .form-group(style='padding-top:10px') 
     button.btn.btn-sm(type='submit') Update 

私は何をしないのですか? divsのように違いはないはずですか?

+3

あなたの行とフォームグループのdivが子供の代わりにフォームの兄弟であるように見えます。 –

+1

@DanielSchafferそれはそれをしました。今明らかになっているようだ。ありがとう。 –

答えて

2

あなたのインデントは正しくありません。フォームとdivは兄弟ですが、divはフォームの子でなければなりません。

.container 
    h5.panel-title Candidate Details 
    hr 
    form.form-group.input-group-sm(method='POST' action='') 
     .row 
      .col-sm-4 
      label.form(for='name') Name 
       input#name.form-control(type='text', placeholder='John Smith...' name='name' required='true' value=(undefined===candidate ? '' : candidate.name)) 
      .col-sm-4 
      label.form(for='signed_offer_letter') Signed Offer Letter:  
       input(type='checkbox', name='signed_offer_letter', checked=(undefined===candidate || candidate.signed_offer_letter!= true ? false:true)) 
     .form-group(style='padding-top:10px') 
      button.btn.btn-sm(type='submit') Update // Nothing happens on submit. 
関連する問題