469,356 Members | 2,322 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

Automatic onsubmit?

<form onsubmit="call_rss();return false;">
<input type="text" name="rssurl" id="rssurl" size="40"
value='Skype'>
</form>

The code above has the value "Skype" and only after hitting Enter/
Return key, the value is submitted. How can the value "Skype" be
submitted automatically without pressing Enter/Return key?

Thanks for the tips, gurus :)

May 17 '07 #1
1 1848
Andy said the following on 5/17/2007 1:12 PM:
<form onsubmit="call_rss();return false;">
<input type="text" name="rssurl" id="rssurl" size="40"
value='Skype'>
</form>

The code above has the value "Skype" and only after hitting Enter/
Return key, the value is submitted. How can the value "Skype" be
submitted automatically without pressing Enter/Return key?
You could start by asking the same question twice in 3 minutes.

window.onload = submitTheForm

function submitTheForm(){
document.forms['theForm'].submit()
}

And give your form a name attribute of "theForm"

P.S. It would be better to use return call_rss() and have call_rss
return true or false.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 17 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Stuart Wexler | last post: by
2 posts views Thread by Andy | last post: by
2 posts views Thread by Sorrow | last post: by
8 posts views Thread by Mark Livingstone | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.