By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

Adding Spaces in a FormBox

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a

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.