No validation for adding options products without options

Posted By TheCalicoTree Mon 22 Aug 2011
Add to Favorites0
Author Message
TheCalicoTree
 Posted Mon 22 Aug 2011
Supreme Being

Supreme Being - (71,106 reputation)Supreme Being - (71,106 reputation)Supreme Being - (71,106 reputation)Supreme Being - (71,106 reputation)Supreme Being - (71,106 reputation)Supreme Being - (71,106 reputation)Supreme Being - (71,106 reputation)Supreme Being - (71,106 reputation)Supreme Being - (71,106 reputation)

Group: Forum Members
Last Active: Thu 18 Jun 2015
Posts: 98, Visits: 1,382
I have noticed that the system allows you to add an options product without selecting any options.

I am trying to code this so that the button click fires a validation event to check that all options have been chosen.  I made the following change to the ProductVersions.ascx.vb page but that is only checking that any option has been selected and not all.

Having looked further into the OptionsContainer.ascx.vb code I am a little confused as to how I can interogate each dropdown and check that the selected option is not 0.

I was trying to go down this route....

Public Function ValidOptionsSelected() As Boolean
For Each obj In phdOptions.Controls
If Control.SelectedValue = 0


return false

Next
Return true


End Function

Protected Sub btnAdd_Options_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd_Options.Click

If UC_OptionsContainer.GetSelecetedOptions = "" Then

UC_PopupMessage.SetTitle = "No Options Selected"

UC_PopupMessage.SetTextMessage = "Please select product options before adding to basket."

UC_PopupMessage.SetWidthHeight(300, 70)

UC_PopupMessage.ShowPopup()

Else

Dim strNonSelectedOptions As String = UC_OptionsContainer.CheckForValidSelection()

If strNonSelectedOptions Is Nothing Then



Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top