/    Sign up×
Community /Pin to ProfileBookmark

[js] putting value form button to active input

hello. i have big problem.
i have form and few inputs –

name<input type=”text” name=”pName” id=”pName” />
phone<input type=”text” name=”pPhone” id=”pPhone” />
etc

and i have buttons (whole keyboard emulation)
this part works only in one input
<input type=”button” name=”n1″ value=”1″ onClick=”pName.value=pName.value+n1.value;”> and so on.

my problem is that – i want to use this button to multiple inputs in one form. When I click on some input ex. – pPhone or sometging else this fiels is active. Next I click button and value form this button should be inserted into active input.

what should i do? please help

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @pucha 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.18,
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,
)...