/    Sign up×
Community /Pin to ProfileBookmark

Here is my dilemna.

I need a text box when it is being typed into, to go to a script that does a few things…

  • 1.

    It gets the id or name of the text box and trucates to only include the number in it (example: pos1 truncates to 1)

  • 2.

    Once it has that number it looks at the value of the text box and if the value is a certain value it stores another value in a variable.

  • 3 Takes the new value and puts it into the other text box that has the 1 for the name or id (example: points1)

    So, a user types in the value 5 in the text box pos1. The text box below it, points1 now has a value of 92.

    Any ideas?

    Thanks,

    to post a comment
    JavaScript

    3 Comments(s)

    Copy linkTweet thisAlerts:
    @toicontienJan 20.2006 — You can start with the onchange="" event handler, which gets fired every time the value in the text box changes. Other than that, I have no clue what you're trying to do ?
    Copy linkTweet thisAlerts:
    @tabzterJan 21.2006 — huh? ?
    Copy linkTweet thisAlerts:
    @espylacopaauthorJan 22.2006 — ok, let me start by asking, how do i get the name or id of the current text box that is being typed into? document.form1.? and store it in a variable.

    And then, how would I or what function would take that variable and eliminate the alpha characters and leave only the numeric?
    ×

    Success!

    Help @espylacopa 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.25,
    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,
    )...