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

Hide text input

P: n/a
Hi.
I wrote a form that has few text inputs
Is it possible to hide unused text input ?

Could you show me how?

Thanks.
Leszek
Jan 27 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Leszek" <le*******@poczta.onet.pl> wrote in message
news:dr**********@news.onet.pl...
Hi.
I wrote a form that has few text inputs
Is it possible to hide unused text input ?

Could you show me how?


Define "unused text input".

CSS' display and visibile can be used to "hide" HTML.

But it's not clear what you want to do.

An inoput box would only be "unused" (empty?) at
the point at which the form is submitted and why
would you want to hide it then?

Jan 27 '06 #2

P: n/a
onblur="if(this.value=='')this.stle.display='none' ;" or
onblur="if(this.value=='')this.stle.visibility='hi dden';"

add this code in your all inputs. if cursor click and not wrotes
something than cursor moves other input, former input will hide.

Jan 27 '06 #3

P: n/a
sorry, change this.stle.... >> this.style...

Jan 27 '06 #4

P: n/a
nothingrows said the following on 1/27/2006 5:23 AM:

Please quote what you are replying to.

If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
onblur="if(this.value=='')this.stle.display='none' ;" or
onblur="if(this.value=='')this.stle.visibility='hi dden';"

add this code in your all inputs.
No. Do not add that code to all your inputs. Use the onsubmit handler to
trigger a function that will loop through the inputs and hide the ones
that aren't used.
if cursor click and not wrotes something than cursor moves
other input, former input will hide.


And if the user accidentally hits the tab key and moves to the next
field? They have no way to correct the mistake.

Or, if they do not click into the input at all? They are left visible.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 27 '06 #5

P: n/a
In article <11*********************@z14g2000cwz.googlegroups. com>,
ko*******@gmail.com says...
sorry, change this.stle.... >> this.style...


Are you replying to something? Please quote correctly. Even Google
Groups has this capability.

--

Hywel
http://kibo.org.uk/
Jan 27 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.