/    Sign up×
Community /Pin to ProfileBookmark

Easy question: Haven’t done for so long forgot how

Ok, I have an input field I want to add to an href. I’v forgotten how in Javascript. In Java it would be <%=var%> but this is client side.

Thanks for the help with this easy one

James

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@LeruraOct 20.2005 — if you have an ID="" in the inputfield then

location.href=document.getElementbyId('[COLOR=Red]inputfieldID[/COLOR]').value
Copy linkTweet thisAlerts:
@jlopes151authorOct 20.2005 — And if there is more than one href in the doc?? I can use its id as in

hrefid.????
Copy linkTweet thisAlerts:
@LeruraOct 20.2005 — if you mean a frameset it [COLOR=Red]parent.[COLOR=Blue]TheOtherFramesName[/COLOR].location.href[/COLOR]
×

Success!

Help @jlopes151 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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