This is a migrated thread and some comments may be shown as answers.

[Solved] AutoFill

3 Answers 140 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Miroslav
Top achievements
Rank 1
Miroslav asked on 29 May 2009, 10:32 AM
Hi,

I just registered and on the register page I recognized one bug:
If you use AutoFill Country drop down list will be filled automatically by browser but when you try to continue, error message appears saying that country is not entered. Missing ID?

3 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 01 Jun 2009, 10:56 AM
Hello Miroslav,

I tried reproducing the issue on the registration form without success.

Could you specify under which browser the issue appeared when you registered as well as the steps you have followed?

Kind regards,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Miroslav
Top achievements
Rank 1
answered on 01 Jun 2009, 11:24 AM
Hello,

I tried it again and reproduced it in Firefox:
If you have Google toolbar installed and use AutoFill feature, pressing AutoFill on the toolbar will fill all of fields that are entered in your autofill settings. If country is not empty, the country drop down on your registration page will be also filled, but I guess the proper event don't occur to initiate updating the state of selected/entered country. I have all of the javascript enabled (I don't even know if google's addon use javascript or lower level code). Autofill feature is used quite much, so it may be the real issue for some places.

regards,
Mirko
0
Simon
Telerik team
answered on 09 Jun 2009, 11:24 AM
Hi Miroslav,

Indeed the issue reproduces in FireFox and only there.

When the AutoFill operation of Google Toolbar is used FireFox changes the corresponding field's values on a lower level, e.g. the respective events (onchange) do not fire, hence RadComboBox could not update its selected Item automatically.

Fortunately you could workaround the issue with some additional client-side code. More specifically you could use a CustomValidator and a client validation function which would select the Item corresponding to the entered text and would indicate whether the field is valid or not.

Below follows a sample:

<div> 
    <telerik:RadComboBox ID="Country" runat="server" AllowCustomText="true"
    </telerik:RadComboBox> 
    <asp:CustomValidator ID="CountryValidator" runat="server" Display="Dynamic" ErrorMessage="Please select Country." 
        ClientValidationFunction="validateCountry"></asp:CustomValidator> 
    <asp:Button ID="Submit" runat="server" Text="Submit" /> 
</div> 

function validateCountry(source, args) { 
    var comboBox = $find("Country");             
    var item = comboBox.findItemByText(comboBox.get_text()); 
     
    args.IsValid = true
     
    if (item) 
        item.select(); 
    else 
        args.IsValid = false

Greetings,
Simon
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
Tags
General Discussions
Asked by
Miroslav
Top achievements
Rank 1
Answers by
Simon
Telerik team
Miroslav
Top achievements
Rank 1
Share this question
or