Onblur problem with combobox

I have a vb.net web program using onblur for field validations and it works fine on text box.  But combo box seems to ignore it.  Is there some otherway to do onblur on combobox?
Who is Participating?
COANetworkConnect With a Mentor Commented:
An Ajax combo, as opposed to a drop-down list, is really a combination of two controls, as mentioned in one of those links I suggested.  it's tricky binding events to it.  Look on the bright side - you can create that code once, encapsulate it and use it or all your combo boxes.
try onchange()
CPOINT2000Author Commented:
onchange did not work.  my code is below.  function validvalueALFNUM works perfectly fine for textbox onblur event.

<asp:ComboBox ID="orgcategory" onchange="validvalueALFNUM(this, 'Business Category', 1, 25, 0, 1)" runat="server" AutoCompleteMode="Suggest"
CssClass="regInput" MaxLength="25" RenderMode="Block" TabIndex="11"
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

CPOINT2000Author Commented:
Thanks, I had read the above.  I searched all over the net also so far have not found a simple solution.  I was hoping there was a simpler solution then wring an entire section to do a onblur on a combo box.
CPOINT2000Author Commented:
Thanks.  I placed the following code under page load (vb code) using my own variable and it worked;

Dim txtStartTime As TextBox
txtStartTime = cbxStartTime.FindControl("cbxStartTime_TextBox")
If txtStartTime IsNot Nothing Then
    txtStartTime.Attributes.Add("onBlur", "javascript:Set_EndDateTime(null, this);")
End If

Is that where I should keep it (under If Not IsPostBack Then)?
and I have several other dropdown boxes, so I would need one of these for each basically?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.