Jump to content

Resetting data in combobox

Recommended Posts

Here is the situation. I have the attached script. A person enters in the form and submits the information. Everything works except my grade combobox. Instead of it defaulting back to nothing like the other 4 boxes it just doubles up the nbr of items in the combo box.

You really have to look at it to see so any help would be very much appreciated.


P.S. choose only 3rd grade.


Link to post
Share on other sites

Alright I found out where I could fix it.  Instead of this:

$GradeData = '1|2|3|4|5'

I needed this:

$GradeData = '|1|2|3|4|5'

Don't understand why.  If someone could explain it to me I would really appreciate it.



I don't know why either, but I have discovered two things:

1. If where the data is first set contains the "" default, the grade levels do not duplicate (even without the leading pipe).

2. Since the grade levels do not change, the data does not have to be set again in each loop. Therefore, the GUICtrlSetData for the grade levels, in the loop, can be eliminated.


Link to post
Share on other sites

Thanks Lazycat.  But, why are the data duplicated when the first character is not an empty string or a pipe?  It's acting as an "Add" function, which can be okay, but not described in the help file.


Hmm, maybe this a small docs flaw... This is by design: if here not pipe at first place, data will be added to old content of combobox (or listbox). You are right, this some sort of "Add". I'm not remember exactly, why this was made so... maybe JP can explain.
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...