Default Values in form

I am using the 100000 combo box example for populating zip codes in a form. The submit form works well, values are recorded to my database correctly. However, I have an edit form where I pull the values previously recorded out of the database. I then set up and edit form with those values using the combo box, here is what that looks like in my code, $value is the previously recorded value from the database:











I am using the value of ZIP_new_value to check whether the value is in the predefined list or not, if the value is false then I allow the edit to go through, if the value of ZIP_new_value is true, then I throw and error stating the zip code is invalid. My problem is upon the code above being executed the form looks correct, the value from the database is selected in the drop down correctly, but upon submitting the edit form the ZIP_new_value is true even though the zip is in the predefined list. How can I have the Zip checked while the list is populated so the variable id ZIP_new_value set correctly to false?



Wasn’t sure how to handle this. Thanks for any suggestions.




You can try to use the following approach:


combo.addOption($value,$value)
z.setComboValue("$value");



In this case $value will be marked as existent in combo.