Forums

Hide fields in template

lansman 18 Jul, 2009
Hey,

I have added the ability for users to add more fields and need it to be shown in the template.
I saw different post by bob about inserting a php IF statement to the template, but this cannot be done, as the template editor
removes the <?php tags.

so how to hide the fields in the template if unfilled ?

for example I have these fields in my file:
{product-url1}
{product-notes2}

{product-url4}
{product-notes5}

{product-url7}
{product-notes8}

{product-url10}
{product-notes11}
...go on to 30 more fields...

and i don't want to see a {blah blah} in the mail i get if no one wrote something.

Thank you.
GreyHead 19 Jul, 2009
Hi Lansman,

If you look at the Email Setup Properties you will find an option to turn off the HTML template editor, this will let you add PHP to the the template. I think that you have to save the form and open it again from the Froms Manaager for the change to take effect.

Bob
lansman 19 Jul, 2009
Can you pleaaaaaase provide a working example of php code
to hide these 2 fields if no content was submitted?

{product-url1}
{product-notes2}

I am working on this part of the form hours on hours on hours... but cannot get it on.
I really don't want to quit now.

It should be a small and easy example for you guys...

Thanks in advance.
GreyHead 19 Jul, 2009
Hi lansman,

See this post but you'll need to substitute your field names.

Bob
lansman 19 Jul, 2009
Hallelujah !

At last, Success !
Thank you very very much!
This topic is locked and no more replies can be posted.