Current location: Hot Scripts Forums » General Web Coding » JavaScript » javascript form


javascript form

Reply
  #1 (permalink)  
Old 08-16-03, 05:39 AM
dave111 dave111 is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
javascript form

This is a pretty simple question.

I have a javascript form, the form processes when you click the submit button, how do i make it so that the form also processes when you hit enter??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 08-17-03, 02:38 AM
dave111 dave111 is offline
Wannabe Coder
 
Join Date: Jul 2003
Posts: 136
Thanks: 0
Thanked 0 Times in 0 Posts
No one knows?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 08-21-03, 01:36 AM
nd2 nd2 is offline
Wannabe Coder
 
Join Date: Jun 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
you dont realy beleave that?
i commented the script to make it a bit easier to read what it does, it's very simple like you said and i dont see where you could use this type of script most browsers submit on enter any way.

<form name="bob" METHOD="post" ACTION="http://ncaster.cjb.net">
<input type="text" name="textfield">
<input type="submit" name="Submit" value="Submit">
</form><script language=javascript>

// this is our java script even, on key down.
document.onkeydown=go_submit();


function go_submit() { // this is our submit func
var key= event.keyCode; // get key
if(key == 13) { // 13 = enter
document.forms['bob'].submit(); // submit bob form
}
}

</script>
__________________
IonCMS (Coming Soon.)
http://ioncms.com
--
Ncaster (Free php/mysql cms)
http://ncaster.cjb.net
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkboxes on form = mailto recipient. Bojon PHP 4 12-21-04 07:07 PM
SQL database registration form help vinhkhuong PHP 3 10-10-03 04:49 AM
asp: URGENT! need to change code to create new form per id seala ASP 2 09-09-03 10:54 PM
close form sasi ASP 4 08-26-03 04:51 AM
Need Bravenet Alternative... bobby444 General HotScripts Site Discussion 10 07-17-03 10:36 PM


All times are GMT -5. The time now is 10:12 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.