I am preparing app using phonegap.In app i have displayed list of data and one search bar.User can search by particular name.Here i have used jquery ajax.It is working fine.My problem is when click on search bar soft keyboard will open automatically.After enter the text just click on “GO” button in soft keyboard i call search method.It is also working fine.But cursor is still visible on search bar.I want to make the cursor invisible on clicking “GO” button from soft keyboard.My code is,
function submitOnEnter(inputElement, event)
{
console.log("KEY OCDE:: "+event.keyCode);
if (event.keyCode == 13)
{
caSearch();
}
}
Please guide me to over come this.
Use these attributes, which will make it impossible to select your edittext and will therefore deselect if for you.
yourEditText.setFocusable( false );yourEditText.setFocusableInTouchMode( false );Immediately afterwards, reverse these two prices of code
yourEditText.setFocusable( true );yourEditText.setFocusableInTouchMode( true );That should remove the cursor from search bar for you