E
Eric D. Braden
I feel like a fool for asking this; seems like I would have had more
luck with Google, but alas...
This is a little baby bit of code that a friend cooked up over a year
ago. My problem is simply that hitting enter doesn't really submit
the input. It just reloads with a cleared form. My desired effect is
for hitting the Enter key to have the same effect as clicking the
Submit button.
Here's the code:
<!-- saved from url=(0013)about:internet -->
<script language = "javascript">
function opensite()
{
location = "http://www.state.ar.us/dfa/personnel_mgmt/
classcodes/"+entry.num1.value+".txt";
}
</script>
<center>
<h2 align = "center">Enter the Class Code and click Submit</h2>
<form id = "entry">
<table>
<tr>
<td>
<input type = "text" id = "num1"></input>
</td>
</tr>
<tr>
<td align = "right">
<input type = "button" id = "submit" onclick = "opensite()" value =
"Submit"></input>
</td>
</tr>
</table>
</form>
</center>
<h3 align = "center"><font color = "Navy">You will find the MQs at the
bottom of the page.</font></h2>
I tried to make heads or tails of this post
:
http://groups.google.com/group/comp.lang.javascript/browse_thread
/thread/39d8b289a95afe79/10c205b5f6d17a0f?lnk=st&q=
javascript+enter+key#10c205b5f6d17a0f
but I couldn't get it working.
(and, yes, I know GoogleGroups is the devil, but I can't get a real
newsreader at work)
luck with Google, but alas...
This is a little baby bit of code that a friend cooked up over a year
ago. My problem is simply that hitting enter doesn't really submit
the input. It just reloads with a cleared form. My desired effect is
for hitting the Enter key to have the same effect as clicking the
Submit button.
Here's the code:
<!-- saved from url=(0013)about:internet -->
<script language = "javascript">
function opensite()
{
location = "http://www.state.ar.us/dfa/personnel_mgmt/
classcodes/"+entry.num1.value+".txt";
}
</script>
<center>
<h2 align = "center">Enter the Class Code and click Submit</h2>
<form id = "entry">
<table>
<tr>
<td>
<input type = "text" id = "num1"></input>
</td>
</tr>
<tr>
<td align = "right">
<input type = "button" id = "submit" onclick = "opensite()" value =
"Submit"></input>
</td>
</tr>
</table>
</form>
</center>
<h3 align = "center"><font color = "Navy">You will find the MQs at the
bottom of the page.</font></h2>
I tried to make heads or tails of this post
:
http://groups.google.com/group/comp.lang.javascript/browse_thread
/thread/39d8b289a95afe79/10c205b5f6d17a0f?lnk=st&q=
javascript+enter+key#10c205b5f6d17a0f
but I couldn't get it working.
(and, yes, I know GoogleGroups is the devil, but I can't get a real
newsreader at work)