+1
Searching answer

Clearing a textfield

Lcdrgreg fa 10 anys updated by icahill (Administrator) fa 10 anys 3
I am creating a on the fly SQLite db and writing to it from a form with various textfields. When I complete the form it writes to the db, how can I clear the form. I have tried using the assign object.alias.text to reassign to value=" " but it does not clear the textfields. tried with a separate action, sync tag, cant figure it out. Considering making the form a class and creating / deleting it. what do you think?
Doing something along the lines of this should work:


<assign property="object:PASSWORD.text" value="" />


Can you post your action so I can trouble shoot it?
This will do the trick, must have had a typo.


<wire>
<main>
<panel name="main" alias="MAIN" width="100%" height="100%">
<textfield name="hi" alias="HI" width="100%" height="10%" font="helvetica" size="25" color="ffffff" fieldcolor="ff0000" alignment="center" border="line" placeholder="Hi"></textfield>
<panel name="button" width="180" height="100" background="ffffff" bottomof="hi" align="center" onclickup="Go">
<text name="remove" width="100%" height="100%" color="#ff0000" font="Helvetica" size="25" alignment="center" text="Remove"></text>
</panel>
</panel>
</main>
<actions>
<action name="Go">
<assign property="object:HI.text" value="" />
</action>
</actions>
</wire>
That is exactly what I tried. I did get it to work converting the form to a class and then creating it, filling it out and on return, deleting it. Thanks, I think this will be more efficient and we will use this same form for multiple subjects. Thanks for making me figure out the DB thing, helped a lot in understanding how it works to have to go through it painfully.

Next question, when I write to the database it does not sort, but I think I just figured it out while writing the question, think I need to tell it to sort in the action.