/    Sign up×
Community /Pin to ProfileBookmark

Changing button text

I have one sub webpage which is called from various other web pages which I would like the text on a button to

change according to the language the main
webpage – ie button text = close, fermer etc. I have defined a function to work out the text to put on the button

called getCloseText() but how can I call this from within the html input markup?
The code i have is below (simplified).
Any help appreciated

regards Bob (novice at javascripting)

<html>
<head>
<title>Bedroom</title>

<script type=”text/javascript” language=”JavaScript”>
<!–
function closeWin() {
myWin= close(“no.htm”, “displayWindow”, “width=600,height=400,status=no,toolbar=no,menubar=no”);
}

function getCloseText() {
return (“f e r m e r “);
}

–>
</script>
</head>

<body>

<img style=”padding-bottom: 10px” src=”../img/bedroom1-m.jpg” alt=”Photograph of Bedroom 1″ />

<input type=”button” value=”getCloseText()” onclick=”closeWin()” />

</body>
</html>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@toicontienMay 07.2008 — JavaScript really isn't the solution you want here. You need a server side scripting language and a content management system if you want to do multiple languages on one page. Have you looked into Joomla?
×

Success!

Help @rhammer 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.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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