jQuery UI Widgets › Forums › Lists › DropDownList › Combo Box Auto Focus
Tagged: combo box, combobox, focus, jqxComboBox, validation
This topic contains 6 replies, has 2 voices, and was last updated by RavikumarR 12 years, 2 months ago.
-
AuthorCombo Box Auto Focus Posts
-
I am placing Combo in my form . in this Combo i am not entered the value then i manually check the validation.
whether the combo have value or not. After validate the value is not there then want to focus the combo.
is it possible.Hello RavikumarR,
Could you, please, post a code sample so that we may be able to reproduce the reported behaviour and be able to help?
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/This is my code
function CreateCombo(ComboId, ComboData, ComboColumns, ComboDisplay, ComboValue,ComboAutoHeight) {
var theme = ”;
var cmbData = document.getElementById(ComboData).value;
var url = cmbData.replace(/#/g, ‘”‘);
var lscode = ComboValue;
var lsname = ComboDisplay;
var lsCols = ComboColumns.split(‘,’);
var source =
{
datatype: “json”,
datafields: [
{ name: lsCols[0] },
{ name: lsCols[1] }
],
id: ‘id’,
localdata: url,
async: false
};var dataAdapter = new $.jqx.dataAdapter(source);
$(ComboId).jqxComboBox({ selectedIndex: -1, source: dataAdapter, displayMember: lsname, autoDropDownHeight: ComboAutoHeight, dropDownHeight: 130, valueMember: lscode, width: 200, height: 20, theme: theme });
}
$(document).ready(function() {
CreateCombo(‘#jqxProduct’, ‘product’, ‘CompanyName,ContactName’, ‘ContactName’, ‘CompanyName’,true);
CreateCombo(‘#jqxTeam’, ‘teamname’, ‘CompanyName,ContactName’, ‘ContactName’, ‘CompanyName’,true);
CreateCombo(‘#jqxMessageType’, ‘messagetype’, ‘CompanyName,ContactName’, ‘ContactName’, ‘CompanyName’, true);
CreateCombo(‘#jqxMessageIcon’, ‘messageicon’, ‘CompanyName,ContactName’, ‘ContactName’, ‘CompanyName’, true);
CreateCombo(‘#jqxButtonStyle’, ‘buttonstyle’, ‘CompanyName,ContactName’, ‘ContactName’, ‘CompanyName’);
CreateCombo(‘#jqxHelpId’, ‘helpid’, ‘CompanyName,ContactName’, ‘ContactName’, ‘CompanyName’);});
var item_product = $(“#jqxProduct”).jqxComboBox(‘getSelectedItem’);
if (item_product == null) {
alert(“Please select value in Product”);
// how to focus the JqxProduct combo
return false;
}In this JqxProduct Combo i want to focus …..
Hi RavikumarR,
To focus on a combobox’s text input, you may do the following:
var item_product = $("#jqxProduct").jqxComboBox('getSelectedItem'); if (item_product == null) { alert("Please select value in Product"); $("#jqxProduct input").focus(); };
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
Thanks for your response . its working fine.
i have one more clarification in tab page movement. i have place the combos contiguously . tab movement is not proper.
double tab then only it will focused.Hi RavikumarR,
This is because the first time when the Tab key is pressed, the focus goes to the combobox arrow (you can then press Enter and the select options will be shown) and on the second press, the focus goes to the combobox input.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
Thanks for your information Dude…With Regards,
Ravikumar.R -
AuthorPosts
You must be logged in to reply to this topic.