validation control status?

  • Thread starter Thread starter js
  • Start date Start date
J

js

Hi, I have a text box and DropDownList control and a validation control,

When user entering a number in the text box, based on the entered number,
the dropdrownlist value will change
(document.getElementById('dnn_ctr-1_Register_ddReferral').value =
document.getElementById("dnn_ctr-1_Register_txtReferral").value;) and the
validation control will valify the dropdownlist if it's empty.

I found there is a problem the server side Page.IsValid will always return
false and ?ddReferral.selectValue is empty. But it works fine if I manually
pick a item from the dropdownlist.

What's the problem, do I need to chagne some value status after I use
javascript to assign value to the dropdrownlist control? Please help. Many
thanks.
 
js said:
Hi, I have a text box and DropDownList control and a validation control,

When user entering a number in the text box, based on the entered number,
the dropdrownlist value will change
(document.getElementById('dnn_ctr-1_Register_ddReferral').value =
document.getElementById("dnn_ctr-1_Register_txtReferral").value;) and the
validation control will valify the dropdownlist if it's empty.

I found there is a problem the server side Page.IsValid will always return
false and ?ddReferral.selectValue is empty. But it works fine if I manually
pick a item from the dropdownlist.

What's the problem, do I need to chagne some value status after I use
javascript to assign value to the dropdrownlist control? Please help. Many
thanks.

You can't assign a value to a dropdownlist. You have to set the
selectedIndex property to select one of the items.
 
Back
Top