Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Entry.Value is empty

$
0
0

I have run into this issue as well and have been using the following workaround. 

Using the following settings:

AllowCustomEntry=true
InputType=Text
TextSettings-SelectionMode=Single

Withing the DropDownItemTemplate I put a javascript onclick event that calls a method to populate hidden fields.

ASPX:

1.<DropDownItemTemplate>
2.    <tableonclick="RadAutoCompleteBox_StoreData('<%# DataBinder.Eval(Container.DataItem, "RecordID")%>','<%# DataBinder.Eval(Container.DataItem, "RecordText")%>');">
3.        <!-- DropDownItemTemplate Text -->
4.    </table>
5.</DropDownItemTemplate>

Javascript:

functionRadAutoCompleteBox_StoreData(value, text) {
    varSelectedText = text;
    varSelectedValue = value;
     
    // populate the hidden fields based on the values sent from the list item
    $("#hf_SelectedText").val(SelectedText);         // store the data text
    $("#hf_SelectedValue").val(SelectedValue);       // store the data value
    $("#hf_ListItemFound").val("1");                 // indicate a list item was found
}
 
functionRadAutoCompleteBox_TextChanged(sender, eventArgs) {
    // do a quick check to see if a list item was found
    if($("#hf_ListItemFound").val() == "1") {
        $("#hf_ListItemFound").val("0");                   // reset the list item found
    } else{
        // populate the hidden fields based on the text entered
        $("#hf_SelectedText").val(eventArgs.get_text());   // use the textbox value
        $("#hf_SelectedValue").val("0");                   // set a default value
        $("#hf_ListItemFound").val("0");                   // reset the list item found
    }
}

 

When the form is submitted, I just pulled the needed data from the hidden field. I populated the Text in a hidden field to keep it transparent. Typically, I just pull the text from the RadAutoCompleteBox.Text. 


Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>