Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

showing cursor in textBox

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi here I'm using onFocus event on a textbox which will call the following function:

function clearDateField(fieldName)
{
if (document.getElementById(fieldName).value == "mm/dd/yyyy")
{
document.getElementById(fieldName).value = "";
}
document.getElementById(fieldName).focus();
return true;
}

The problem is it is making foucs on the textbox after I press TAB key but it is not showing the cursor. Only if I type something then only the cursor is coming....

How to make the cursor visible after pressing the Tab key from the previous field?

Regards,
Debashree
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using onblur or onchange on the field to call that function?

Eric
 
Debashree Halder
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using onfocus to call that function
 
He does not suffer fools gladly. But this tiny ad does:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic