/    Sign up×
Community /Pin to ProfileBookmark

text box delay

Hi,

The script below is meant to change the text in a form name fname, in a text field called “box”. But it doesn’t, any ideas?

function changetext(box){
document.fname.[box].value=”testing”;
}

dom

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@PittimannJan 12.2004 — Hi!

Not knowing, what parameter is passed to the function (the red "box") => function changetext([COLOR=red]box[/COLOR]){

take that and leave the rest unchanged for a first result:

document.fname.box.value="testing";

Cheers - Pit
Copy linkTweet thisAlerts:
@fredmvJan 12.2004 — Welcome to the forums.function changetext()
{
document.fname['box'].value = "testing";
}
Copy linkTweet thisAlerts:
@ucbonesauthorJan 12.2004 — OK,

Think I'm halfway there! Basically this script is the result if a username/password combination is entered incorrectly. The page is re-directed to this script, which shows a series of text boxes. Each text-box is whirring through a list of fake ip's, and I want them, in order, to stop. The form is called "iptrace", and the text boxes are named "ip1", "ip2" etc.

<script>

function ranno(){

return Math.floor(Math.random()*255);

}

function myrandomip(){

return ranno() + "." + ranno() + "." + ranno() + "." + ranno();

}

function showip (box) {

ipID = setTimeout("showip(box)",50);

document.iptrace[box].value='Tracing Route: ' + myrandomip();;

}

</script>

the problem appears to be with the line that says showip(box), as it says box is undefined.

I'm attempting to call the function with

<script>

showip('ip1');

</script>
Copy linkTweet thisAlerts:
@ucbonesauthorJan 12.2004 — fixed it now- if anyone wants I'll post my finished script!
×

Success!

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

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...