Auto Submisson - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Webmaster Support (https://www.supportforums.net/forumdisplay.php?fid=36) +---- Forum: Website Development (https://www.supportforums.net/forumdisplay.php?fid=43) +---- Thread: Auto Submisson (/showthread.php?tid=2698) Pages:
1
2
|
Auto Submisson - Scorpion - 11-08-2009 What's Up? OK, So i have created a script that automaticly submits data, And its working, Well sort of. You see I want the script to be able to submit the data upon the page loading. ( body onload="document.forms.post.submit();"> ) Well you see when I manuly click the submit button it works, But when i use that onload script, The forum sends me to the post new topic section. Anyone Know Why? Thanks Bye. RE: Auto Submisson - Gaijin - 11-08-2009 I'm not sure right now, but did you tried to put the script inside of script tags at the bottom of your page. Or in the head tags, Code: <script langauge="javascript" type="text/javascript"> edit: How is your form named, "forms" or "post". RE: Auto Submisson - Scorpion - 11-08-2009 Quote:How is your form named, "forms" or "post". Code: <form name="post" id="Submit" method="post" action="http://www.co.uk/forum/posting.php?mode=reply&t=36001"> I tried it in a <script>, Sorry for being such an idiot but in your script do you replace the form in form.submit(); to what my form name is? I know I know I'm such a ass. RE: Auto Submisson - Gaijin - 11-08-2009 First yes. form.Submit(); is to be changed with the name of your form, in your case you would use document.post.Submit(); If javascript is executed before the form it won't work because the form wasn't loaded. You should install Firebug... And Firefox has it's own error console which is also useful to view if there is something wrong with your script. edit: You should also define value attribute within your input or textarea fields. RE: Auto Submisson - Scorpion - 11-08-2009 Code: <script type="text/javascript"> ** Added, I tried "post.submit();" on a mouseover= event, So i could wait until the page was loaded then submit the script, But it still sends me to the post new topic section, So it must be something to do with the submission. RE: Auto Submisson - Gaijin - 11-08-2009 (11-08-2009, 12:05 PM)Scorpion Wrote: I tried "post.submit();" on a mouseover= event, So i could wait until the page was loaded then submit the script, But it still sends me to the post new topic section, So it must be something to do with the submission. OK, this must work for auto submit, Put this code just before you are closing your </from> Code: <script language="javascript" type="text/javascript"> That should submit your form, as for the part when it sends you to New Topic, I can only assume that something is wrong with the action attribute of your form. I would nee to see the code that handle the form submit. RE: Auto Submisson - Scorpion - 11-10-2009 Quote:That should submit your form, as for the part when it sends you to New Topic, You want to good news or the bad news? Well actually theirs no good news, Still sends me to the new topic page. Here's the full html script. Code: <form name="post" id="Submit" method="post" action="http://www.teamxlink.co.uk/forum/posting.php?mode=reply&t=36001"> Im trying to post a thread on a a forum called xlink forums [forget what that forum is about just used it as a testing ground] One thing after another huh? Thanks Bye. RE: Auto Submisson - Gaijin - 11-10-2009 (11-10-2009, 12:00 PM)Scorpion Wrote: Im trying to post a thread on a a forum called xlink forums [forget what that forum is about just used it as a testing ground] Ok your are trying to post a new thread, not a new reply for another thread, if that's so you need to change the action in your form to Code: http://www.teamxlink.co.uk/forum/posting.php?mode=newtopic&f=55 f=55 is the forum id. RE: Auto Submisson - Scorpion - 11-10-2009 Quote:'Master of The Universe' pid='26866' dateline='1257880025'] Do you want the good news or the bad news? Well actually their is no good news, It still sends me to the post new topic bit. One thing after another after another? RE: Auto Submisson - Gaijin - 11-10-2009 Wait I don't really understand where the form needs to go. Do you want to send you to post a new thread or post a new reply on a thread. |