/    Sign up×
Community /Pin to ProfileBookmark

Auto submit form after value

Hello,
I’m searching for this:

I scan a barcode with a x numbers to an inputfield. When there are x characters in the inputfield I want to automaticly submit the form.

I was thinking of a “auto change tab script”. When there are x charaters I want to submit instead of tab.

Can someone help me on this one?

Thanks!!
Samall

[upl-file uuid=3a16a1ea-5315-4671-a1a8-ab20fad10995 size=2kB]tab.txt[/upl-file]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KorNov 05.2004 — As a user, I would not like to submit something without choosing myself the moment, with no warning, no button... Are u sure is OK what you wanna do?
Copy linkTweet thisAlerts:
@samallauthorNov 05.2004 — It is not a public webapplication. I want to use it in combination with a barcode scanner.
Copy linkTweet thisAlerts:
@KorNov 05.2004 — [code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script language="JavaScript" type="text/JavaScript">
var x=10;//nr characters
function submitT(t,f){
if(t.value.length==x){
f.submit()
}
}
</script>
</head>
<body>
<form>
<input name="txt" type="text" onkeyup="submitT(this,this.form)">
</form>
</body>
</html>
[/code]
Copy linkTweet thisAlerts:
@samallauthorNov 05.2004 — Thanks a lot!!

That is working fine.
×

Success!

Help @samall spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...