File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes show/hide formfields Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "show/hide formfields" Watch "show/hide formfields" New topic
Author

show/hide formfields

Pradeep
Ranch Hand

Joined: Sep 19, 2006
Posts: 49
I have to show/hide formfields
following functions are correct???

function clickPCSpec()
{
document.forms[0].tag_size.visible = true
document.forms[0].flight_no.visible = false
document.forms[0].gate_value.visible = false

}

function clickECSpec()
{
document.forms[0].tag_size.visible = false
document.forms[0].flight_no.visible = true
document.forms[0].gate_value.visible =true

}
P Lavti
Ranch Hand

Joined: Mar 27, 2007
Posts: 65
To hide:
document.forms[0].tag_size.style.display = "none";

To show:
document.forms[0].tag_size.style.display = "";

Get more details at HTML DOM Display Property


-P Lavti<br />SCJP 5.0 (88%)
Pradeep
Ranch Hand

Joined: Sep 19, 2006
Posts: 49
Thanks...............

I also want to show/hide name associated with formfield.For example

Flight No. textfield) then how to show/hide Flight No. which appear on browser
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

The easiest way to show/hide some part of the page (form, field or anything inside) is using CSS.
Put the part you want to show/hide in a div, and change the display-property.

hope it helps.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: show/hide formfields