How to validate that a combobox item was selected

Posted by: klgrube on 7 January 2018, 4:32 pm EST

    • Post Options:
    • Link

    Posted 7 January 2018, 4:32 pm EST

    For three comboboxes on an ASP.Net sheet, I have set the first value to 0 with the text of “* Please make a selection …” There is no default value in the database intentionally but there is a constraint that says > 0, so I know the database won’t be updated. It’s just that I don’t know the best way of letting the user know what happened.

    I need to make sure the three values are greater than 0 when a user hits the Update command button.

    I’m not sure what the code should look like for checking whether or not a user has actually changed a drop-down value before updating the database and that it meets certain criteria. They have to choose something from the drop-down list. I don’t know how to validate that.

    Any guidance would be appreciated.

  • Posted 8 January 2018, 1:30 am EST

    Hello,

    You would need to create a custom combobox celltype and set the attribute for onChange in GetEditorControl method.

    Please refer to the attached sample application.

    Thanks,

    Deepak SharmaSpreadWebItemChangedCombo.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels