How to assign a variable name to a html button from within a scriplet

Hi,

Would anyone know how I could assign the names of the button to the value held in entry rather than the string 'entry' as it is currently doing?

Many thanks

<% Iterator iterator = reidMap.keySet().iterator();

int counter = 1;

String entry = new String();

while (iterator.hasNext()) {

entry = (String)iterator.next();

String value = (String)reidMap.get(entry);

out.print("<TR><TH>" + counter + "<TH>" + entry + "<TH>" + value + "<TH>" + "<input type=\"button\" value=\"eee\" name=entry onClick=\"alert(this.name)\"; />" );

counter ++;

}

%>

[669 byte] By [ainemita] at [2007-11-26 19:49:01]
# 1

hi,

i'm not sure of what you want but something like this might help

<%

...

out.print("<TR><TH>" + counter + "<TH>" + entry + "<TH>" + value + "<TH>" + "<input type=\"button\" value=\"eee\" name=\""+value+"\" onClick=\"alert(this.name)\"; />" );

...

%>

-

alban.maillerea at 2007-7-9 22:37:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...