aspose file tools
The moose likes JSP and the fly likes how to assign a java variable as a value to an html radio button? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "how to assign a java variable as a value to an html radio button?" Watch "how to assign a java variable as a value to an html radio button?" New topic
Author

how to assign a java variable as a value to an html radio button?

aatish pandya
Greenhorn

Joined: Apr 20, 2011
Posts: 21
Suppose,
[code=java]

<%
String type = "credit";
%>

<body>
<input type="radio" name="type" value=<I want to assign the above String variable [i]type[/i] here> />
.
.
.
</body>
[/code]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56232
    
  13

You should not be using Java scriptlets in JSP any longer. Please read this JspFaq entry.

Using the EL, if a String existed as a scoped variable named type, the syntax would be:


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: how to assign a java variable as a value to an html radio button?
 
Similar Threads
setting a radio button
help with radio buttons
parameter to servlet
Radio Button,Check Boxes
Problem integrating Input box with JSP