v9 javaScript for clearing values from text box on form

Can anyone help me with adding some client script to buttonClick event, that will clear values from txtBoxA/B/C on MyForm?

Tagged:

Comments

  • I'm not sure what you want to do, but you could just assign empty string to this textbox. Client side function setField for example.

  • So apologies from not being very granular with that question. I have a form, that contains a grid tied to a solution table via query BO with auto refresh. There are some controls tied to local vars, and I want the user to be able to build that grid before the process moves on. So users can enter information click the button which populates the grid (readOnly). Everything works except I want to be able to clear the values from those text boxes on the buttons click event as well. I already have a server action tied to the button click event, can I also tie a client script action as well without conflict?

     

    so this is what I tried:

     

    function ClearValues()

    {

         SetField("textboxA","");
    }

     

    i have entry fields for date, number, text and memo that I would like to achieve this for.

     

    So if this isn't the solution, is there a better way to achieve the goal?

     

    Thanks in advance for all help!

  • Your grid population is being done by a visual or server side script I presume.

    You can clear your form variables at the same time if so just by assigning "" (or whatever is appropriate) to the Local. values.  You want to make sure the form fields are "is dependent" for them to show as cleared on the form.

  • Thanks. I tried assigning values to begin with to accomplish this, but missed the "is dependant" portion.

     

    Works fine. Thank you again.