Skip navigation
Currently Being Moderated

Clear all items that was selected from dropdown list

Mar 30, 2012 6:20 AM

I have dropdown box with list of predifined items, from which I can select items into a text field with an add and remove buttons. these all work very nice.

 

Currently I have to remove one by one item incase I made some wrong selections via the remove button. You need to select the item and then click remove to have the item remove.

the section under the remove button is as below and work 100%

 

form1.ListSAPApplication.deleteItem(form1.ListSAPApplication.SelectedI ndex);

 

I would now like to add another button to "clear all" selections from the text field without the necessity to first select the item. When I click CLEAR ALL button all of the selections should be cleared..

 

any idea how to write the statement to clear ALL selections from text box.

 

Thank you kindly.

 
Replies
  • Currently Being Moderated
    Mar 30, 2012 8:19 AM   in reply to bliksimpie

    There are a lot of examples for reset button in this forum.  Can you use resetData() which clears all the fields in the form?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 30, 2012 10:35 AM   in reply to aenigmabella

    Hi,

     

    There is an example here: http://assure.ly/jcHEyc.

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 1:43 AM   in reply to bliksimpie

    Hi,

     

    The resetData() will clear all data. The example above is intended to show how you can target specific fields.

     

    However you want to remove specific sections within the textfield, which will require the replace() method. This is where you look for a match in the textfield's .rawValue and replace it with an empty string "".

     

    You can't upload files directly to the forums, but if you put it in a file sharing site and post the published link here I will have a look at it when I can.

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 2, 2012 2:34 AM   in reply to bliksimpie

    Hi,

     

    I would recommend Acrobat.com, but please bear in mind that you need to Publish the file before it is available to anyone else.

     

    Have a look at this example I did up for someone else. https://acrobat.com/#d=6hEiR5CSyQe1yUiqWXwEbg. Here it is looking at the rawValue of the listbox and stripping out the newlines (\n).

     

    It might help,

     

    Niall

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points