[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 2 Questions



 PoDzPaGe@aol.com wrote:

 >1st Question: How can i make Javascript look in a textbox & if all there is 
>in that box is "test" it will clear the textbox? but if there is more than 
>just "test" in that box it will ok it.
>

Not knowing exactly how you want to do this I will give a generic 
answer for a single input TYPE="text" form describing the form before 
the function (normally reverse order) for clarity:

<FORM NAME="test_form">
   <INPUT TYPE="text" NAME="test_input" SIZE=40>
</FORM>


function checkForTest(){
   if(test_form.test_input.value == "test"){
      test_form.test_input.value = "";
   } else {
      ok();
   }
}

The 'else' code above assumes you have a function to process
acceptable input, otherwise remove the 'else' code.

John
--------------------------------------------------------------------
For help about the list, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.
List archives and pointer to FAQ: http://www.obscure.org/javascript/