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 depending on the value the required fields should come Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "depending on the value the required fields should come" Watch "depending on the value the required fields should come" New topic
Author

depending on the value the required fields should come

lalith kumar
Greenhorn

Joined: May 09, 2008
Posts: 17
hi,

i am having problem like if i select one value that value related fields should come and if i select another value other fields should be displayed in previous field space only.

pls help me...
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29220
    
135

Lalith,
You would need to write a Javascript method to do that. What do you have so far?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

Originally posted by lalith kumar:
pls help me...

Please use real words when posting to the forums. Abbreviations such as "pls" in place of "please" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
lalith kumar
Greenhorn

Joined: May 09, 2008
Posts: 17
hi Jeanne Boyarsky,

I tried that by using javascript. suppose if there are two text fields in our page. Depending on the value it has to display the text field. I am writing that code in javascript only i am hidding the unwanted text field. But problem is with space like in the first text box field place second one has to get replaced.

Thank you
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Why don't you show us what you have done so we can see what the problem is by giving us an example test case.

Eric
lalith kumar
Greenhorn

Joined: May 09, 2008
Posts: 17
hi,

suppose if there are three fields like date,venue and reason.These are included in jsp page like




And i have one select box as candidate status



if i select candidate status as attended means it has to display only two fields that is date and venue fields.

If i select candidatus as postponed means it has to display only reason field. This is working fine by using javascript code:



But the problem is when i select candidate status as postponed it will display only the reason but gap is coming because we are hidding date and venue. I want to remove that space and reason should come in date field place. Is it possible.

Thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: depending on the value the required fields should come
 
Similar Threads
Dropdown populates other fields
Want to call struts action on click of jsp combo box
Message to show database update
Refresh on selecting a field.
fields should be mandatory depending on drop down select