Solution:
Capture the key event in the form and determine whether to press Ctrl or enter. If yes, submit the form using the submit method of the form.
<Form action = "test. asp" onkeydown = "If (event. ctrlkey & event. keycode = 13) This. Submit ()">
<Textarea name = "content"> </textarea>
</Form>
Tip: Besides onkeydown, the event handle of the buttons also includes onkeyup and onkeypress. You can use event. ctrlleft to determine the ctrl key on the left.
<HTML>
<Head>
<Title> Ctrl Enter submit </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Script language = "JavaScript">
Function checkform ()
{
If (document.myform.txt name. value = "")
{
Alert ("file name cannot be blank! ");
Document.myform.txt name. Focus ();
Return false;
}
Return true;
}
Function quicksubmit ()
{
If (event. keycode = 13 & event. ctrlkey)
{
If (checkform ())
{
Document. myform. Submit ()
Return true
}
Else
Return false
}
}
</SCRIPT>
</Head>
<Body bgcolor = "# ffffff" text = "#000000" onkeydown = "Return quicksubmit ()">
<Form name = "myform" method = "Post" Action = "work_edit2.asp">
<P> File Name:
<Input type = "text" name = "txtname">
</P>
<P> description:
<Textarea name = "txtareanote"> </textarea>
</P>
<Input type = "Submit" name = "Submit" value = "Submit" onclick = "Return checkform ()">
(CTRL + enter submit)
</Form>
</Body>
</Html>