/    Sign up×
Community /Pin to ProfileBookmark

Replace values using Javascript

Hi all,
I having a string like this.

[code=php]<INPUT onkeypress=ValidateTime() id=t2_2 onblur=validateBtime(document.Baco.t2_2) style=”WIDTH: 50px” maxLength=5 value=20:00 name=t2_2>[/code]

Now I want to replace the

[CODE]value=20:00[/CODE]

with another value. How can I do this using Javascript.

Thanks
Dana

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERFeb 04.2008 — Hi all,

I having a string like this.
[code=php]<INPUT onkeypress=ValidateTime() id=t2_2 onblur=validateBtime(document.Baco.t2_2) style="WIDTH: 50px" maxLength=5 value=20:00 name=t2_2>[/code]

Now I want to replace the [CODE]value=20:00[/CODE] with another value. How can I do this using Javascript.

Thanks

Dana[/QUOTE]

Try:
[code=php]
document.getElementById('t2_2').value = '25.55';
[/code]

usually in a function called from something in the <head> section.
Copy linkTweet thisAlerts:
@danasegaraneauthorFeb 04.2008 — Thanks for the reply JMRKER .

Here I am trying to write a function will loop through the values of the table values in the HTML and assing the values. So I cannot hardcode this one

Thanks

Dana
Copy linkTweet thisAlerts:
@JMRKERFeb 04.2008 — Do you have more of an example of what you want to loop through

or a link to where the problem lies?
×

Success!

Help @danasegarane 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.16,
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,
)...