ASPxClientEditBase.GetValue Method
Returns the editor’s value.
Declaration
GetValue(): any
Returns
Type | Description |
---|---|
any | An object representing the editor’s value. |
Remarks
Use the GetEditValue method to access the value being edited by an editor.
The editor’s edited value can be represented by different data entities, depending upon the editor type. So, for a text editor this method returns a value identical to the text contained with the editor. However, for a check editor it returns ASPxCheckBox.ValueChecked or ASPxCheckBox.ValueUnchecked, depending upon the current editor’s state. The edited value of a list box editor is specified by the ListEditItem.Value property of the currently selected list item. For an ASPxGridLookup, this method returns a value identical to the text contained within the edit box.
Example
The complete sample project is available in the DevExpress Code Central database at E942.
function OnValidationCompleted(s, e) {
if(e.isValid && Password.GetValue() != ConfirmedPassword.GetValue()) {
ConfirmedPassword.SetFocus();
ErrorMessageNotEqual.SetVisible(true);
e.isValid = false;
} else
ErrorMessageNotEqual.SetVisible(false);
}
<script runat="server">
protected void Page_Load(object sender, EventArgs e) {
}
protected void ASPxGlobalEvents1_ValidationCompleted(object sender,
DevExpress.Web.ValidationCompletedEventArgs e) {
lErrorMessageNotEqual.ClientVisible
= !tbPassword.Value.Equals(tbConfirmedPassword.Value);
}
</script>
...
Type password:<br/>
<dxe:ASPxTextBox ID="tbPassword" runat="server" Width="170px"
ClientInstanceName="Password" Password="True">
<ValidationSettings SetFocusOnError="true">
<RequiredField IsRequired="True" />
</ValidationSettings>
</dxe:ASPxTextBox>
<br/>
Confirm password:
<dxe:ASPxTextBox ID="tbConfirmedPassword" runat="server" Width="170px"
ClientInstanceName="ConfirmedPassword" Password="True">
<ValidationSettings SetFocusOnError="true">
<RequiredField IsRequired="True" />
</ValidationSettings>
</dxe:ASPxTextBox>
...