giles
giles

Reputation: 1

Auto trigger submit

I've been working on the following (with some very good help from users here at stackoverflow). It works brilliantly, but now I realise it needs to trigger when the page loads rather than on a trigger. I'm a newbie to client side, so would appreciate your help.

  <script language="Javascript">function checkjava(){return 1}</script>
</head>
<body>
  <form action="enabled_catch.php" method="get" onsubmit="this.js.value=checkjava();">
    <input type="hidden" name="js">
    <input type="submit" value="click me">
  </form>

Thanks in advance.

Giles

Upvotes: 0

Views: 399

Answers (1)

Gert Grenander
Gert Grenander

Reputation: 17084

How about:

<body onload="document.forms[0].submit();">

Upvotes: 1

Related Questions