Good morning,
I've got quick question this morning for you all, you know when you use the Patterns button on an object and that you then add a string of text under 'allow empty', what it does is it displays that string in the field and if you click into the field, the string disappears, and if you type out of the field without writing anything, it puts it back.
Thats great!!!
Can i replicate the same behavior but using JAvascript???
Thats it, just curious to see if its doable
Patrick
Solved! Go to Solution.
Views
Replies
Total Likes
Patterns are usually used to process the input to any field at runtime, which can also be handled by js without configuring the field settings.
- You can set a raw value to the field at certain events like form load, for example, Initialize event.
- The default text is removed if the user tries to enter any value, for example, Enter event.
- If the value is null and the user exits the field, reset the field to raw value, for example, Exit event.
You just need to set/reset the values at certain events at runtime.
Patterns are usually used to process the input to any field at runtime, which can also be handled by js without configuring the field settings.
- You can set a raw value to the field at certain events like form load, for example, Initialize event.
- The default text is removed if the user tries to enter any value, for example, Enter event.
- If the value is null and the user exits the field, reset the field to raw value, for example, Exit event.
You just need to set/reset the values at certain events at runtime.
Here's a great example of doing this with scriptings. It not only displaying a defalut text for empty fields but also change the colors etc.
Guys thank you so much, that's what i needed. and i understand the events better now as well. but i can't seem to get the link to work, it's giving me an error message but I'm very curious to see the example now
@patrickpai share the sample form and the script and we will try to see what you are missing in the code.