Skip to main content

I would like to set the default value for web address since it needs to start with http://.

Is there a way to set the default value? Or maybe change the value above the textbox from "Type the web address:" to "Type the web address: ex: http://www.google.com"

URL.png

I have found that you can enter in text to help the user, but for the user to see this text they need to hover their mouse over the text "Type the web address:"  and wait for the popup to display.

URL_Help.png

As you can see above I have also tried to use JavaScript to accomplish this, but I am not very proficient in JavaScript and was not successful in doing this.

Thanks,

Chad

Hello Chad – In order to accomplish this, you'd probably want to set the placeholder property for your text-box through JavaScript. This would allow your help text to be inside of the input box instead of on hover of the control. happy.png

Assuming you've got a text-box with a JavaScript Client ID variable of "testField," the following would append placeholder text like you're wanting:

NWF$('#' + testField).attr("placeholder", "Here's some placeholder help text...");

Good luck!

Patrick


Thank you Patrick, that works great.

Using this idea it is also possible to use the following to enter in a default value:

NWF$('#' + testField).attr("value", "http://");  

No problem – glad this worked for you!


Reply