How do I hide unfilled fields in a form?
I know this code <?php echo $form->data['data']; ?> shows the field, but i didn't have success in some PHP code to hide the field.
Can somebody help me?
I know this code <?php echo $form->data['data']; ?> shows the field, but i didn't have success in some PHP code to hide the field.
Can somebody help me?
Hi cesarvelame,
What exactly is the problem? What do you need to hide and where?
Bob
What exactly is the problem? What do you need to hide and where?
Bob
I have the field "Motivo" unfilled and i need it hidden when is unfilled.
See this:
See this:

Hi cesarvelame,
OK, then you need to use PHP in the Email template. To do this you *must* have the Rich Text Editor turned off so that there is just a text area. Find the part of the template code that contains the <tr>. . .</tr> part for Motivo and change it like this:
Bob
OK, then you need to use PHP in the Email template. To do this you *must* have the Rich Text Editor turned off so that there is just a text area. Find the part of the template code that contains the <tr>. . .</tr> part for Motivo and change it like this:
<?php
if ( $form->data['Motivo'] ) {
?>
<tr>
. . .
</tr>
<?php
}
?>
Bob
Thanks, but I would use this code in the form, not in the email.
I did this and it works:
I did this and it works:
<?php
if ( $form->data['motivo'] ) {
echo "<label>Motivo</label>{motivo}";
}
?>
Hi cesarverlame,
Yes, that will work.
But why do you need to hide parts of the form? Just curious, I don't think I've seen that request before.
Bob
Yes, that will work.
But why do you need to hide parts of the form? Just curious, I don't think I've seen that request before.
Bob
GreyHead, I did a small system with Chronoforms.
I have 4 forms:
Content Submission - fields name and content
Content Management - fields name, content, status (pending, rejected and published), link (when published) and motive (when rejected)
Content Status Query - field code (unique id gh)
Content Status View - fields name, status, link and motive ( both if filled by the admin)
People sends content and receives a code that they can query the status in any moment.
In the Status View form I wanted only to show the fields filled by the admin.
Did you understand? My english is crap, I´m sorry.
I have 4 forms:
Content Submission - fields name and content
Content Management - fields name, content, status (pending, rejected and published), link (when published) and motive (when rejected)
Content Status Query - field code (unique id gh)
Content Status View - fields name, status, link and motive ( both if filled by the admin)
People sends content and receives a code that they can query the status in any moment.
In the Status View form I wanted only to show the fields filled by the admin.
Did you understand? My english is crap, I´m sorry.
This topic is locked and no more replies can be posted.