php - Form with Bootstrap+Tabs not send all item on POST event. Only first tab work fine -
i'm working on laravel 4.2 + blade.
when send form post, , capture exit dd(item:all) first 5 elements of form $var.
after load page edit settings, laravel , blade show code. think it's correct.
<form method="post" action="http://fqdn.com/settings" accept-charset="utf-8" novalidate="novalidate" class="form-horizontal" id="formsettings"><input name="_token" type="hidden" value="iflxf11zf8afgfqszjyobgmizqvlxprsel8n6ffk"> <div class="tab-content"> <!-- tab storage --> <div role="tabpanel" class="tab-pane active" id="storage"> <div class="col-sm-12"> <div> </div> <!-- option remote --> <div class="form-group" id="groupremote"> <div class="form-group "> <label for="storageserver" class="col-sm-3 control-label">remote storage server</label> <div class="col-sm-9 "> <input class="form-control" placeholder="fqdn or ip" name="storageserver" type="text" id="storageserver"> </div> </div> <div class="form-group "> <label for="storageport" class="col-sm-3 control-label">port remote storage server</label> <div class="col-sm-9"> <input class="form-control" placeholder="port number" name="storageport" type="text" id="storageport"> </div> </div> <div class="form-group "> <label for="storageuser" class="col-sm-3 control-label">user remote storage server</label> <div class="col-sm-9"> <input class="form-control" placeholder="username" name="storageuser" type="text" id="storageuser"> </div> </div> <div class="form-group "> <label for="storagepath" class="col-sm-3 control-label">path on remote storage server</label> <div class="col-sm-9"> <input class="form-control" placeholder="/remote/path" name="storagepath" type="text" id="storagepath"> </div> </div> </div> <!-- option local --> <div class="form-group hidden" id="grouplocal"> <div class="form-group "> <label for="storagelocal" class="col-sm-3 control-label">path on remote storage server</label> <div class="col-sm-9"> <input class="form-control" placeholder="/local/path" name="storagelocal" type="text" id="storagelocal"> </div> </div> </div> </div> </div> <!-- stop send par key & value of rest of elements of form <!-- tab frecuency --> <div role="tabpanel" class="tab-pane" id="frequency"> <div class="col-sm-12"> <div> </div> <div class="form-group" id="groupfrequency"> <div class="form-group "> <label for="maxdaily" class="col-sm-3 control-label">limit copies (daily)</label> <div class="col-sm-9"> <input type="text" class="form-control" id="maxdaily" placeholder="number copies"> </div> </div> <div class="form-group "> <label for="maxmonthly" class="col-sm-3 control-label">limit copies (monthly)</label> <div class="col-sm-9"> <input type="text" class="form-control" id="maxmonthly" placeholder="number copies"> </div> </div> <div class="form-group "> <label for="maxsnap" class="col-sm-3 control-label">limit copies (snap)</label> <div class="col-sm-9"> <input type="text" class="form-control" id="maxsnap" placeholder="number copies"> </div> </div> <div class="form-group "> <label for="alertsize" class="col-sm-3 control-label">max size</label> <div class="col-sm-9"> <input type="text" class="form-control" id="alertsize" placeholder="85 (maximum size of space on server send alert)"> </div> </div> </div> </div> </div> </div> <div class="col-sm-4 col-sm-offset-4 text-center"> <input class="btn btn-primary btn-block" type="submit" value="save"> </div>
sort of dd(input::all()); on settingscontroller.php
array (size=6) '_token' => string 'iflxf11zf8afgfqszjyobgmizqvlxprsel8n6ffk' (length=40) 'storageserver' => string '' (length=0) 'storageport' => string '' (length=0) 'storageuser' => string '' (length=0) 'storagepath' => string '' (length=0) 'storagelocal' => string '' (length=0)
i don't understand , don't see error on form.
the code works fine if see 5 inputs(when radio boxes not checked), because if checkbox , radio boxes not checked not transfered post variables. if have:
<input type="checkbox" name="a" value="a" checked="checked"></input>
your post variable named have content "a"
<input type="checkbox" name="a" value="b" checked="checked"></input>
your post variable named have content "b"
<input type="checkbox" name="a" value="a"></input>
your post variable named not set(of course if checkbox not checked in form).
edited:
you don't have name attribute in last 4 inputs, add them "name" , work.
Comments
Post a Comment