I'm putting Gravity Form on our homepage using the php include function.
1) How can I remove the Labels from the fields
2) How can I make the values inside the inputs to disappear once the input is clicked on?
Thanks
I'm putting Gravity Form on our homepage using the php include function.
1) How can I remove the Labels from the fields
2) How can I make the values inside the inputs to disappear once the input is clicked on?
Thanks
I've implemented this for a client that worked great, its semantic and has good fall-back support and validation stays intact.
There is also a variant way to do this here: http://www.gravityhelp.com/clearing-default-form-field-values-with-jquery/
That feature is not built into GravityForms? It's a pretty basic feature to click the field and have the the value disappear (it doesnt even need to be jQuery - just a simple line of code inside the <input>
What about removing the form Labels?
We purposefully have not built this functionality in yet as we would prefer to do it solely with HTML5 instead of jQuery.
You can hide labels with CSS - do you have a link to your form?
Ok. I'll wait for that too.
Form is on this page: http://www.heritagelawmarketing.com/
I'm having a hard time styling it though. Seems to be more involved than I thought. I was under impression there are a bunch of templates to choose from and modify rather than having to style it all myself.
You can use this to hide the labels (for this specific form):
[css]
#gform_wrapper_1 .gfield_label {
display: none;
}
What exactly did you have in mind for styling? I can help guide you here.
Yes. I got that part working. I have one problem though, when I set the "Input Value" to be something (Ex. 'Enter Your Name') it seems that the form is taking that as a value and not validating the field for an actual input anymore.
That's because it is technically a value and can be submitted. This is one of the drawbacks of using default values as "labels". That's where using the jLabel approach I linked to is more bulletproof. It is a customization and does require some basic knowledge of jQuery and placement in files - but it works great.
jLabel will take the actual "label" and place it inside of the input and retain validation. You can see a demo of that here which I did for a freelance client.
Thanks. Is there a tutorial somewhere on how to implement that with Gravity forms?
If you view the source of that page link I sent you, with my example on it. All the way at the bottom you will see a reference to a jLabel file. If you path to that and open it up, just grab that and place it in to your theme. Then just change the selectors as necessary:
jQuery('#gform_wrapper_1 input:text, #gform_wrapper_2 input:text').jLabel();
What that is doing is targeting all text inputs in forms with the ID of 1 and 2.
Thanks. I did that (copied the jLabel file. Its also going to be for the first form made on my site so the ID number would be the same as yours (#gform_wrapper_1). It didn't work on my site though. Should I be including anything else also?
http://www.heritagelawmarketing.com/
Thanks
Nima
Nima,
It looks like your site is including two versions of jQuery. At the top you have the latest, which is correct. But then further down the page you have a much older version:
You also have a JS error: Screenshot
You're right. It seems like the slider plugin is adding its own (old) jQuery. i have to see if I can find it and take it out. Thanks for the help
Rob,
I fixed the problem that was pulling extra (old) jQuery into the page. I also added the jLabel script. The form puts still dont change when clicked on.
Nima,