Hi,
1. Is there any way to get a prompt box to show up in the middle of the screen rather than the top-left?
2. I'm looking for some code that will move to the next text box when 2 characters are entered in the current box.
Thanks,
Al.
Hi,
1. Is there any way to get a prompt box to show up in the middle of the screen rather than the top-left?
2. I'm looking for some code that will move to the next text box when 2 characters are entered in the current box.
Thanks,
Al.
For centering, try:
<form>
<br><br><br><br><br><br><br><br>
<center><input name="prompt_box"></center>
</form>
For auto-tabbing you would use JavaScript and you would add an
onChange="tabFunction(this)" to your input field, i.e.:
<input name="prompt_box" onChange="tabFunction(this)">
Then you would set up the tabFunction(string) to check to see if string.length is greater than 2 and if so, tab to the next field.
cudabean
Thanks for the reply. I was able to get the tab function to work.
The prompt box is a JavaScript prompt. e.g.
It's this prompt box I'm trying to center on the screen.Code:function EnterPrice(){
Price=prompt("Item 12345 is not in the price file. Please enter your price.");
....
}
Thanks,
Al.
1/ Dont think its possible, it just pops up where it wants too. I'd use a <input type="text"> instead
2/ Try This...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Set Focus After Length Of Characters Has Exceeded</title>
<script language="JavaScript" type="text/javascript">
<!--
// objectID is ID of element
// activateID is ID of element you want to give focus too
// maximum is the maximum length before activateID gets focus
function checkLength(objectID,activateID,maximum){
if (document.getElementById(objectID).value.length==maximum){
document.getElementById(activateID).focus();
}
}
//-->
</script>
</head>
<body>
<form name="form1">
<input type="text" name="text1" id="text1" onkeypress="checkLength('text1','text2',2)">
<input type="text" name="text2" id="text2" onkeypress="checkLength('text2','text3',2)">
<input type="text" name="text3" id="text3">
</form>
</body>
</html>
Hope this helps