/    Sign up×
Community /Pin to ProfileBookmark

inputbox vs. onload and then….

Hi,

i have a submit button + input box, which value i fill with onload in <body>.
if i click the submit button, it will make a formular submit.

my question is: can i replace the submit-button with a js-function on the inputbox that generate the same action as the submit button ??

i have tried “onchange” but it didn’t work, because onchange need :

  • 1. a klick to the input box

  • 2. value change

  • 3. another klick outside the input box.
  • but in my case, i only have a value change of the input box from onload()

    thanks for the help

    to post a comment
    JavaScript

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @RobDavidJul 23.2007 — you don't have to have a sumbit button to submit a form!

    you can submit the form at anytime you want to using javascript!


    document.forms[0].submit();
    Copy linkTweet thisAlerts:
    @schiggyblastauthorJul 23.2007 — oooo if i combined settimeout() with your suggestion, i think it would work just fine... i didn't think about .submit() because i want "to admire" the value in inputbox, before the form beeing send. If i have a submit-button it would do the trick and i have time to admire it....

    but as i said, settimeout before .submit() would do the trick.. what do you think Robdavid ?

    thanks for your help
    ×

    Success!

    Help @schiggyblast 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 4.29,
    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: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

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

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...