I want to change the placeholder text of a asp:TextBox at run time.
please suggest me.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
SharadRank #1,728 · 878 reputationPosted Jun 30, 2015, 7:59 PM EDT
getElementsByName()method to select theinputfields and to change theplaceholderfor each one... see the below code...If you wanted to replace all placeholder text from whole site. add below code in your js file, this will change
Munesh SharmaRank #174 · 13.9K reputationPosted Jun 30, 2015, 7:59 PM EDT
you can use
getElementsByName()method to select theinputfields and to change theplaceholderfor each one... see the below code...document.getElementsByName('Email')[0].placeholder='new text for email';
document.getElementsByName('First Name')[0].placeholder='new text for fname';
document.getElementsByName('Last Name')[0].placeholder='new text for lname';