View Full Version : Auto-Submission, Tricky Code.

01-03-2007, 12:51 AM
<body onload="form1.submit();">
<form name="form1" method="post" action="do-it.php">
<input type="hidden" name="radiobutton" value="5">
<input name="submit" type="submit" id="submit" value="Lets do it.">

Okay. Ive been into html for about a year now. I basicly know it.

I am having aproblem here though. What i believe the problem is, is that the name of the submit button (submit), is getting mixed up with the the "submit()" function. Basicly, they seem to have the same value so to speak.

When i change the value of the button name (form submit, to submit1), it automatically submits as it is suppossed to, but the form IS NOT processed, as the "submit" button seems to be a VALUE in the form -- like "radiobutton".

To put it easy, the buttons values (submit), is needed ot submti the form. But also needed to do it automatically. So when i try to submit the form, nothing happens. I cannot change the name of button, as it is needed for the form to be proccessed. Once i successfully have it auto-submitting, i plan to change the type from button, to hidden.

This is more a goal.

Im not sure exacly how to do this though. I have tryed targeting javascript and everything. Please help me out. Ive been working on this...

01-03-2007, 03:47 AM
I am unsure at what you are saying friend.

Have you tried closing the body tag? That's one thing for starters. I highly doubt that your Function and Name our getting mismatched... but it is possible, I guess. I notice you have submit as your ID name and type. Switch it up a bit. Make the ID something different (I am guessing you are using the submit ID for your CSS). It makes it much easier to read.

01-03-2007, 02:05 PM
Here a similar question was asked, with an alternative approach:


Maybe you can do without the submit button afterall.