/    Sign up×
Community /Pin to ProfileBookmark

Problem – Clearing form box values?

Ok, basically have a frameset, top and bottom frames. A login form on the top frame directs output to the bottom frame…I have a script in the top frame page to clear out the text entered into the textboxes after logging in:


———————————————

<script type=”text/javascript”>
function ClearBoxes() {
document.getElementByID(‘Username’).value=””;
document.getElementByID(‘Password’).value=””;
}

</script>
———————————————

And it is executed when the “Login” button is clicked:

<input type=”image” src=”images/login.gif” class=”normal2″ style=”position: relative; top: -345px; left: 60px; margin-left: 0px;” onclick=”ClearBoxes()” width=”45″ height=”12″ />

But it’s not working, it doesn’t throw errors, just doesn’t clear out the boxes….what could be going on? Someone gave me this script, I don’t know much about JS, so any help would be greatly appreciated…each field has the corresponding ID’s already defined (id = “Username”, etc.)….

Thanks!

T

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@saulssNov 03.2005 — document.getElementByI[COLOR=DarkOrange]d[/COLOR]('Username').value=""; ?
Copy linkTweet thisAlerts:
@SarasotaTimauthorNov 03.2005 — Wow good catch!! Works perfectly now, thanks!

T
×

Success!

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