This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Dynamic form changing with JSTL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Dynamic form changing with JSTL" Watch "Dynamic form changing with JSTL" New topic
Author

Dynamic form changing with JSTL

LakshmiNarayana vishnu
Ranch Hand

Joined: Aug 03, 2006
Posts: 39
Hi,

I have 3 radio buttons in my page...If i select Radio Buitton 1 i have to see 3 fiels and if i select RadioButton 2 then i have to see different fields and If i select RadioButton3 then i have to see different fields compared to previois fileds...



The functionality is same as the link http://www.jsworkshop.com/dhtml/list18-1.html

I want same functionality with JSTL
Please help me on this ASAP...
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by LakshmiNarayana vishnu:

Please help me on this ASAP...

LakshmiNarayana vishnu,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see EaseUp
to find out why adding requests for fast responses (ASAP) can often slow down responses to your question or stop them altogether.


Again, welcome to JavaRanch and good luck with your question.
-Ben


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by LakshmiNarayana vishnu:
I want same functionality with JSTL

In the link you've posted they're doing this with Javascript, on the client.
To do this with JSTL (a server side technology) would require a trip to the server for each radio button click. This is going to much more inefficient and cumbersome than what they're doing.

Why do you want to do this with JSTL instead of Javascript?
LakshmiNarayana vishnu
Ranch Hand

Joined: Aug 03, 2006
Posts: 39
Hi,

I am using websphere commerce ..in thay we have to use JSTL code itself...
Thats why i want code in JSTL instead of JavaScript...

Please help me as early as possible....

Thanks in Advance

Regards,
LakshmiNarayana.V
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Thats why i want code in JSTL instead of JavaScript...

You don't use JSTL instead of Javascript. They serve two completely different purpose. Could you elaborate on why you don't want to use Javascript ?


[My Blog]
All roads lead to JavaRanch
LakshmiNarayana vishnu
Ranch Hand

Joined: Aug 03, 2006
Posts: 39
Hi,

I am using Websphere commerce...here we have to use JSTL tags....Thats why
i am using this tags....

Please clarify this problem

Regards,
LakshmiNarayana.V
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

How are your end users accessing your application; through a browser?
If so, then it doesn't matter what you're using on the server.
Something like this is best done on the client.
To write client side functionality like this, you would use Javascript.
LakshmiNarayana vishnu
Ranch Hand

Joined: Aug 03, 2006
Posts: 39
Even though end users are using through browser if i write html code it is not compatable with existing inbuilt functions...
Thats why using JSTL is necessary...

Please give some idea...

Thanks&Regards,
LakshmiNarayana.V
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

So you're using a framework that builds the HTML for you?
(You don't need to tell us you're using Websphere Commerce. We know that but many of us are not familiar with that product).

What's stopping you from writing your own HTML/Javascript?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Also JSTL is not meant to be a general purpose web scripting language. It can't (and wasn't designed to) replace Javascript. JSTL is a standardized set of custom tags for working with Java objects bound to scope by servlets and Java business objects.

All that being said, a lot of what you want to do can be accomplished on the server using JSTL and EL. It will be slower, more complicated, and for the end user more cumbersome. The problem is, you're still going to need to write some javascript, unless you want the end user to have to click the desired radio button and then click a button to submit the form back to the server where the JSTL and EL reside.
LakshmiNarayana vishnu
Ranch Hand

Joined: Aug 03, 2006
Posts: 39
Hi,

we can write java script also..but i have to include JSTL tags inplcae of HTML tags...

While i am writing those tags i am getting errors...
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

OK, it sounds like you or someone at your company has a deep misconception about what JSTL is. JSTL does not and can not replace HTML tags.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Are you sure that the order from above wasn't to "Use JSTL instead of scriptlets"?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic form changing with JSTL
 
Similar Threads
Auto Populate Combo Box upon Radio Selection
session problem --======urgent plz======--
Struts 1.1: html:radio issues
Wanted to hide and show the fields at runtime
checkbox