The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
Custome html / style in forms - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: Custome html / style in forms (/showthread.php?tid=1053)



Custome html / style in forms - gizmono - 05-01-2018

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


Custome html / style in forms - gizmono - 05-03-2018

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?


Custome html / style in forms - Brandin - 05-03-2018

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.