Please show the code you are using to generate and process the form. On Monday, December 14, 2015 at 12:57:17 AM UTC-5, Jitun John wrote: > > I was trying to replace the Normal Upload button in {{form}} with a button > with nice jquery Browse/File button > > <input id="logs_db_log_file" name="log_file" type="file" class="filestyle" > data-buttonName="btn-primary"data-buttonBefore="true" > data-placeholder="Select a Support Bundle" data-size="nr"> > I can see the view correctly, but the Submit button does not Submit the > fields to the Database. > > Following is the code I am trying > >> <div class="col-lg-6"> >> >> <form action="#" class="form-horizontal" >>> enctype="multipart/form-data" method="post"> >> >> <div class="form-group" id="logs_db_case_num__row"> >> >> <label class="control-label col-sm-3" for="logs_db_case_num" >>> id="logs_db_case_num__label">Case Num</label> >> >> <div class="col-sm-9"><input class="form-control string" >>> id="logs_db_case_num" name="case_num" type="text" value=""> >> >> <span class="help-block"></span> >> >> </div> >> >> </div> >> >> <div class="form-group" id="logs_db_case_desc__row"> >> >> <label class="control-label col-sm-3" for="logs_db_case_desc" >>> id="logs_db_case_desc__label">Case Desc</label> >> >> <div class="col-sm-9"> >> >> <input class="form-control string" id="logs_db_case_desc" >>> name="case_desc" type="text" value=""> >> >> <span class="help-block"></span> >> >> </div> >> >> </div> >> >> <div class="form-group" id="logs_db_log_file__row"> >> >> <label class="control-label col-sm-3" for="logs_db_log_file" >>> id="logs_db_log_file__label">Log File</label> >> >> <div class="col-sm-9"> >> >> <input id="logs_db_log_file" name="log_file" type="file" >>> class="filestyle" data-buttonName="btn-primary"data-buttonBefore="true" >>> data-placeholder="Select a Support Bundle" data-size="nr"> >> >> <span class="help-block"></span> >> >> </div> >> >> </div> >> >> <div class="form-group" id="submit_record__row"> >> >> <div class="col-sm-9 col-sm-offset-3"> >> >> <input class="btn btn-primary btn-default" type="submit" value="Submit"> >> >> </div> >> >> </div> >> >> <div style="display:none;"> >> >> *<input name="_formkey" type="hidden" >>> value="c68b74de-5be9-4a92-90ca-5e7969972fcc">* >> >> <input name="_formname" type="hidden" value="logs_db/create"> >> >> </div> >> >> </form> >> >> </div> >> >> > The reason for it to be not be able to submit is because of the _form_key > which is unique for the session and only {{form}} handles it well. > So, I wanted to know if there is a way to bypass the _form_key so the data > can be submitted to the database ? > Or > be able to change the button and be still be able to use {{form}} ? > > I have attached the formal upload button and the changed one as > screenshots. > I would prefer the later though. >
-- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.