• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

show/hide formfields

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

}
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Pradeep
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic