How to add placeholder text to donation form fields?

Options
How can I add placeholder text to all the inputs in a donation form?



Since I can't directly edit the form code, has anyone found a method to add placeholder text to their form fields? I've tried this method: http://blog.iamcreative.me/code-snipp...



...but I am not very javascript/jQuery savvy.



Thanks!
Tagged:

Comments

  • Hi Jesse,



    To be honest that link tells you all you need. I usually do a little workaround to get the field from the label rather than using the name attribute but otherwise it looks good.



    You can use $ with NetCommunity so


    $('[name*=txtAmount]').attr('placeholder', 'other amount')


    Would add a placeholder to the other donation amount field



    Let us know how you get on... To find the field names just use Chrome and right click on the field > Inspect element and the name="...." bit is what you need.
  • Thank you, Warren!



    When I use your approach, it finally works. Too funny.



    Have a great weekend.
  • Oh and my problem seems to be that I was copying the entire name: PC4806$DonationCapture1$txtPhone instead of just using "txtPhone" for example.



    Thanks again!
  • Yes, the rest of the name field can change when you edit a part and the $ causes issues in matching so just taking the last bit i.e. txtAmount or txtPhone works.



    Good luck.



    W.

Categories