PDA

View Full Version : [Javascript] Auto Submit Form



sysout
09-23-2009, 07:16 AM
emm..how to submit forms like :


<form method="POST" action="http://www.iklanads.com/ads/proses.php" enctype="multipart/form-data">
<input type="hidden" name="judul" value="<?= $title ?>" />
<input type="hidden" name="category" value="<?= $category ?>" />
<input type="hidden" name="urlweb" value="<?= $website ?>" />
<input type="hidden" name="pemasang" value="<?= $name ?>" />
<input type="hidden" name="deskripsi" value="<?= $description?>" />
<input type="hidden" name="e_mail" value="<?= $email ?>" />
<input type="hidden" name="alamat" value="<?= $address ?>" />
<input type="hidden" name="telpon" value="<?= $phone ?>" />
<input type="hidden" name="tag" value="<?= $tag ?>" />
<img width="120" height="30" src="http://www.iklanads.com/button.php" border="1" align="absmiddle" /> <input name="userdigit" type="text" class="isian" size="5" maxlength="5" />
<input type="submit" name="Submit" value="Submit Ads" />
</form>

without clicking the submit button?

Is it possible to send all the input type to : http://www.iklanads.com/ads/proses.php without forms ?

davelf
09-23-2009, 11:38 AM
validate the form without click the submit button is possible but i never heard something like this..?

prasanthmj
09-23-2009, 03:01 PM
Yes; that is possible. If you want to use JavaScript, create a form with hidden input elements and call form.submit() function.
An example where php is used to submit a form is explained here:
submit a form using PHP (http://www.html-form-guide.com/php-form/php-form-submit.html)

sysout
09-24-2009, 01:21 AM
if the submit button has a validation function? how about that? is this works?

magicyte
09-24-2009, 03:06 AM
Well what the heck do you mean by 'automatically'? The user, no matter what, MUST trigger some sort of event to submit the form. Also, I dislike this idea. (I say use forms(forms are NEEDED unless you wanna use AJAX or something, also a disliked idea) and a submit button) If you say automatically, first thing that comes to mind which fits your vague description is "Submit the form whenever they finish filling it out." Sadly, I would say that this is quite inefficient. If you could please be more detailed in your description, I'd be glad to help you out! :) Good luck!

sysout
09-25-2009, 12:32 AM
Well what the heck do you mean by 'automatically'? The user, no matter what, MUST trigger some sort of event to submit the form. Also, I dislike this idea. (I say use forms(forms are NEEDED unless you wanna use AJAX or something, also a disliked idea) and a submit button) If you say automatically, first thing that comes to mind which fits your vague description is "Submit the form whenever they finish filling it out." Sadly, I would say that this is quite inefficient. If you could please be more detailed in your description, I'd be glad to help you out! :) Good luck!

This idea I used for my project to get my current money on e-banking. So I must input username and password (mine of course, just my secret password on my PC), but there's a trigger on the submit button, if I do click that button, it works :(

thanks palz ^^