How to clear text fields


#1

Hi,

I have a form with a bunch of text fields, and I need to clear them onClick of a Button.

First question: how do you clear text in an input field? Just setting the Text value to “” ?

Second question: is there a way to bulk clear all the text fields without having to clear them one by one?

Thanks!


#2

Set textbox_1 equal to “”
Set textbox_2 equal to “”
Set textbox_3 equal to “”
Set textbox_n equal to “”


#3

Thanks, that works, but I was wondering if there was a command to do that in bulk, for example, having the inputs in a group and then setting the text to “” on the group or something like that…


#4

I think I found a quick way: editing the interaction in the interaction pane (the pop up) allows to select multiple objects with a check box see screenshot: 25%20PM


#5

@madven - Can I ask why you’re looking to doing it? I’m just interested in the use case in the context of form usability (not looking to unpick your thinking) :wink:


#6

Happy to answer :slight_smile:

I have a form with many fields, and I wanted to let the user clear the content and start from scratch if the want to. Pretty common case for complex forms.


#7

Hi there, just a quick reply - I just found that creating a variable called ZeroContent with an empty value and then setting the Set Text to the value of the variable works best. It resets the input field and this shows the input hint. When I set the value of text = " " the hint would not show.