-
AuthorPosts
-
February 2, 2015 at 8:14 am #389175
Hello,
I am calling a do_shortcode in a custom template for the contact form.
I need some field to be hidden and prepopulate with some data.I tested:
[av_contact_field label='Name' type='hidden' options='' check='' width='' value='Pippo'][/av_contact_field]but it didn’t work. Do you have any idea to hook this?
thanks!
February 2, 2015 at 10:37 pm #389711Hey Gurify!
Can you send us a link to your page and paste the full customization your doing here so we can get a better idea?
A screenshot highlighting what your trying to do would be helpful too.
Regards,
ElliottFebruary 3, 2015 at 5:45 am #389840Hello Elliot and thanks for support,
I try to better explain what I would like to do.
I want to use the shortcode generated by the contact module in the layout builder.<?php echo do_shortcode( "[av_contact email=' (Email address hidden if logged out) ' title='' button='Inviare' on_send='' sent='La tua domanda è stata inviata!' link='manually,http://' subject='' autorespond='' captcha='' color=''] [av_contact_field label='Nome' type='text' options='' check='is_empty' width='element_half'][/av_contact_field] [av_contact_field label='E-Mail' type='text' options='' check='is_email' width='element_half'][/av_contact_field] [av_contact_field label='Messaggio' type='textarea' options='' check='is_empty' width=''][/av_contact_field] [/av_contact]" ); ?>
This code is working, but I woul like to hide the name, email, and object, becuase the name is the user name, the email is the email of the user and the object is the url of the page. So I need a way to hide and also to assaign the values to that fields.
thanks!
February 4, 2015 at 6:54 pm #390867Hi!
I’m sorry but I’m not sure I understand. Go ahead and send us a link to your page and take a screenshot highlighting what your trying to do so we can get a better idea.
Best regards,
ElliottFebruary 5, 2015 at 6:10 am #391068Ok,
i try to explain this as clearly as I can.
A screenshot of the page is not useful, because you’re going to see a normal page with a normal contact form on it.
Here it is the code of a single.php page ( cleaned from the unnecessary code for this purpose )<?php get_header(); echo do_shortcode( "[av_contact email=' (Email address hidden if logged out) ' title='' button='Inviare' on_send='' sent='La tua domanda è stata inviata!' link='manually,http://' subject='' autorespond='' captcha='' color=''] [av_contact_field label='Nome' type='text' options='' check='is_empty' width='element_half'][/av_contact_field] [av_contact_field label='E-Mail' type='text' options='' check='is_email' width='element_half'][/av_contact_field] [av_contact_field label='Messaggio' type='textarea' options='' check='is_empty' width=''][/av_contact_field] [/av_contact]" ); get_footer(); ?>
as you can see the shortcodes are exactly the shortcodes that the layout builder uses to generate the contact form.
I would like to know how to hide a field, but give a valure to hit. Example: the filed “name”. I want to hide it from the frontend, such a hidden file does, but I want to give it a value ( the username ) and receive it in the email.I tried
[av_contact_field label='Nome' type='hidden' options='' check='is_empty' width='element_half' value='Pippo'][/av_contact_field]
but with no succes.
February 5, 2015 at 12:07 pm #391224Hey!
That won’t work because the
av_contact_field
shortcode doesn’t recognizehidden
as atype
parameter. I’d suggest using an specialized plugin like Contact Form 7, it is possible to make it look exactly as the Enfold one.Regards,
JosueFebruary 5, 2015 at 12:13 pm #391234Ok, I can hide it with css no problem, and what about to assign a value to them. Is it possible?
thanks!February 5, 2015 at 12:24 pm #391245Hey!
That would be possible on the client side using a custom JavaScript script (jQuery val), what values do you want to assign to them?
Best regards,
JosueFebruary 6, 2015 at 6:50 am #391845Hello Josue,
I would like to assign the $user in the Name field, and the $email in the email fields.
thanks!February 6, 2015 at 7:38 am #391855Hi!
Where are those variables defined? can you post a link to the page where you are trying this?
Cheers!
JosueFebruary 6, 2015 at 1:05 pm #391999They are in the php template file I am making: single-custom_post_name.php
February 6, 2015 at 8:33 pm #392258Hi!
OK, here’s a rough example of what you’d need to implement in your template file (check comments):
http://jsbin.com/rexibuxihe/1/edit?html,outputBest regards,
JosueFebruary 10, 2015 at 12:08 pm #393625thanks so much Josue!
February 10, 2015 at 8:59 pm #393967You are welcome, always glad to help :)
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.