× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custome html / style in forms
#1
Hi Guys,

Did play with Forms in US v4.3.23 and it worked well. Cool :-) Did the simple and advanced. I'm special interested in the advanced one, where you do the pre and postprocessForm of the Form separated. As soon the displayForm is called, the HTML gets generated. How is it designed that I can do my own html design of the Form instead produced by displayForm. Like have two columns for the fields instead only one.

if(!empty($_POST)){
$response = preProcessForm();
if($response['form_valid'] == true){
//do something here after the form has been validated
$response = postProcessForm($response);
}
}
displayForm('test');

any hint will help -- many thanks
  Reply
#2
Did check at my own.. in froms.php did change in the function displayView. At the begin of the Form add <div class="row"> after the form header / csrf. And after the formField view loop the closing </div>

function displayView($view, $opts = []){
.........
<input type="hidden" name="csrf" value="<?=Token::generate();?>" />
....
<div class="row">
<?php
foreach ($fields as $f){
.....
formField($fld);
.....
}
</div> <!-- end div from row -->

Sure I can do more changes to fit the needs of different design. But have to change it always if Userspice does an update :-(
Do you have any plan to extend this Forms functionality?
Like: Have in the Forms View admin Custom Raw Html fields. 1. as begin Form View 2. for each field begin and end raw html 3. a form view end raw html.
In addition do you plan to implement a delete, update function for DB rows?
  Reply
#3
Unfortunately where I have not worked on the Form Builder very much, that was @mudmin's project, I can't aid much to this. And if I remember correctly, there is a built in updater to the Form Builder, delete however-I cannot advise on.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)