/    Sign up×
Community /Pin to ProfileBookmark

Changing onblur through scripting

I have a form that I can not edit directly. It is a form used from a provider. They do not format the text in the box. I.E. the name box can be entered as all lowercase or all uppercase. I want the text to be proper like: David.

The problem is that I can’t access the form and change the “onblur” property (event).

I can, however, add text (or javascript) before or after the form. I have tried several variations of the code below with out achieving the results I am looking for. That leaves me with the burning question: Is it possible to use a statement like:

<script language=”JavaScript1.2″ type=”text/javascript”>

document.vw-form.ship-firstname.onfocus=”format()”;

</script>

to change the onblur property (event) to call a function to format the text in the box? Is it possible to change or use any event after the fact at all?

Any assistance is appreciated. If my question isn’t clear, please let me know how I can clear it up for you.

Dave

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@dgerlerauthorMay 07.2005 — I have continued to work on my problem above. I have solved the worst part which was setting the onblur event handler to the new function I write to fix the case of the text to "Xxxxx Xxxxx" from all lowercase or uppercase.

I found this statement to help immensely:

document.forms["vw-form"].elements["ship-firstname"].onblur = new Function("format()");

I hope it helps someone else in the furture.

Dave
×

Success!

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