johannes: was ist "document.pressed?"

Beitrag lesen

hallo

ich habe auf folgender seite

[URL]http://www.javascript-coder.com/html-form/html-form-action.phtml[/URL]

ein beispiel gefunden, wie man das action attribut im form tag dynamisch mit javascript ändert. es lautet so:

<SCRIPT language="JavaScript">
function OnSubmitForm()
{
  if(document.pressed == 'Insert')
  {
   document.myform.action ="insert.html";
  }
  else
  if(document.pressed == 'Update')
  {
    document.myform.action ="update.html";
  }
  return true;
}
</SCRIPT>

<FORM name="myform" onSubmit="return OnSubmitForm();">

<INPUT TYPE="SUBMIT" name="Operation" onClick="document.pressed=this.value" VALUE="Insert">

<INPUT TYPE="SUBMIT" name="Operation" onClick="document.pressed=this.value" VALUE="Update">

</FORM>

jetzt frage ich mich was document.pressed für ein befehl ist. ich habe sowas noch nie gesehen und documentation auch nicht dazu gefunden. ist es einfach eine variablendefinition oder javascript syntax? ein objekt von document? weiß jemand mehr dazu?

fragende grüße,

johannes