This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Omit empty fields from Review page


  1. Markstein
    Member

    Hello,

    I was doing a search and didn't find anything on this. If I have a form which has some fields that are not required and do not get filled in then the fields still appear in the "review page" with the title of the field and then a blank area next to them (since no text was input when a person filled out the form).

    Is it possible to omit the fields that were not filled in from showing up in the review page?

    Thanks a lot,

    Mark

    Posted 13 years ago #
  2. redityo

    Hello,

    Yes it's possible with small customization. You need to edit "includes/view-functions.php" file and search for these code around line 2333 ~ 2339

    if($toggle){
    	$toggle = false;
    	$row_style = 'class="alt"';
    }else{
    	$toggle = true;
    	$row_style = '';
    }

    and change it to

    if((empty($data['value']) || $data['value'] == ' ') && $data['value'] !== 0 && $data['value'] !== '0'){
    	continue;
    }
    
    if($toggle){
    	$toggle = false;
    	$row_style = 'class="alt"';
    }else{
    	$toggle = true;
    	$row_style = '';
    }

    That would make the empty field not included to review page


    MachForm Support

    Posted 13 years ago #

RSS feed for this topic

Reply