471,573 Members | 1,478 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,573 software developers and data experts.

Adding Spaces in a FormBox

Is there a script that would add a space in front of and behind any
text adding to a form box, it coud be triggered by either an onClick or
onBlur event handler. Any help s appreciated. Thanks Joe

Sep 16 '05 #1
2 1585
Papajo schrieb:
Is there a script that would add a space in front of and behind any
text adding to a form box, it coud be triggered by either an onClick or
onBlur event handler. Any help s appreciated. Thanks Joe


What do you want to get? If it's just about optic, you can use CSS (padding). If
you're in need of real blanks, you can do something like

document.getElementById("ID of the inputelement").value = " " +
document.getElementById("ID of the inputelement").value + " "
Sep 16 '05 #2

Papajo wrote:
Is there a script that would add a space in front of and behind any
text adding to a form box, it coud be triggered by either an onClick or
onBlur event handler. Any help s appreciated. Thanks Joe


Why are you adding spaces to your form box entries? Most people want
to trim out any extra spaces. To add a space you should be able to
just say

onclick="nameoftextbox.value = nameoftextbox.value + ' ';"

Are you trying to parse something out of the form box?

http://www.askblax.com

Sep 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.