Hi all what is the best way to get this to stop looping, and only submit once?
Thanks
<script>document.frmSelect.submit();</script>
Hi all what is the best way to get this to stop looping, and only submit once?
Thanks
<script>document.frmSelect.submit();</script>
What do you mean? Can your provide all your code and a link to your page please?
You should also use:
HTML Code:<script type="text/javascript">
Jeremy | jfein.net
Hey Nile I'm not at my house now and I'm having trouble remoting in but essentially the javascript is called by asp code and I really only need to call it once but it just keeps on looping.
Thanks
Ok.. Hmm, put this at the top of your page:
And replace your above code with:Code:<script type="text/javascript"> var once = true; </script>
Code:<script type="text/javascript"> if(once){ document.frmSelect.submit(); } else { return ; } </script>
Jeremy | jfein.net
Hi, thanks again. I made a test document and I don't think it's working. Maybe I'm implementing it wrong:
test.asp
Code:<html> <head> <script type="text/javascript"> var once = true; </script> </head> <body> <form name="frmSelect" action="test.asp" method="post"> <input type="text" name="test" value="test"> <input type="submit" name="submit" value="submit"> <% If request.form("submit") <> "" then response.write "submitted" End If %> </form> <script type="text/javascript"> if(once){ document.frmSelect.submit(); } else { return ; } </script> </body> </html>
this will still loop. you have to set the variable once to false once it is run:
i am not familiar with asp but try:Code:<script type="text/javascript"> if(once){ document.frmSelect.submit(); once=false; } else { return ; } </script>Code:<% If request.form("submit") <> "" then response.write "submitted<script type='text/javascript'>once=false;</script>" End If %>
[Jasme Library (Javascript Motion Effects)] My Site
/\/\@§†ê® §©®¡þ† /\/\@|{ê®
There are 10 kinds of people in the world, those that understand binary and those that don't.
Bookmarks