C
cjl
Hey all:
I have the following html and javascript:
HTML:
<form name="searchme" action="" onKeyPress="checkSection('searchme');">
JAVASCRIPT:
function checkSection(submitter)
{
changeAnatomy(submitter);
}
function changeAnatomy(submitter)
{
if (document[submitter].query.value.slice(0,2) == '00')
{
document.getElementById('anatomy_table').innerHTML = '<div
class="table_title">Anatomy</div><br> 00 - All<br></div>';
}
}
What I want is that when the user enters two digits and they are '00',
the innerHTML will be changed. What I get is a change only after a
third digit (any digit) is entered. BTW - I know that the checkSection
function looks redundant, but other code to validate the input will go
in there soon.
Where am I going wrong?
-CJL
I have the following html and javascript:
HTML:
<form name="searchme" action="" onKeyPress="checkSection('searchme');">
JAVASCRIPT:
function checkSection(submitter)
{
changeAnatomy(submitter);
}
function changeAnatomy(submitter)
{
if (document[submitter].query.value.slice(0,2) == '00')
{
document.getElementById('anatomy_table').innerHTML = '<div
class="table_title">Anatomy</div><br> 00 - All<br></div>';
}
}
What I want is that when the user enters two digits and they are '00',
the innerHTML will be changed. What I get is a change only after a
third digit (any digit) is entered. BTW - I know that the checkSection
function looks redundant, but other code to validate the input will go
in there soon.
Where am I going wrong?
-CJL