Hi.
i'm new user of jsp and i have this problem.
I post my code
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="it.yacme.mystiquexml.mapping.Modello"%>
<%@ page import="it.yacme.mystiquexml.mapping.*" %>
<%@ page import="it.yacme.mystiquexml.business.YacmeRemote"%>
<%@ page import="it.yacme.mystiquexml.presentation.YacmeLocator"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.StringTokenizer"%>
<%!
String jndiURL = null;
public void jspInit() {
jndiURL = (String)getServletConfig().getInitParameter("mystique.server.jndi.url");
}
%>
<%
YacmeRemote ccb = null;
try {
ccb = YacmeLocator.bind(jndiURL);
} catch (Exception e) {}
%>
<html>
<head>
<!--<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -->
<META HTTP-EQUIV = "pragma" CONTENT="no-cache">
<title>Demo MyStique</title>
<script type="text/javascript" language="JavaScript">
function crea(valore,identificatore){
nuovo_elemento = document.createElement("div");
now= valore;
nuovo_elemento.innerHTML=now.toLocaleString();
document.getElementById("container").appendChild(nuovo_elemento);
obj=eval("document.getElementById(\"quadro"+parseInt(document.getElementById("container").childNodes.length)+"\")");
idArticolo= identificatore;
}
function mostraID(){
alert(idArticolo);
}
</script>
</head>
<body>
<center>
<table>
<tr>
<th class="title">Demo MyStiqueXML</th>
</tr>
</table>
<p /><br />
<form action="../pages/maschera.jsp" id="form01" method="post">
<h1>Scegli il tipo di documento che vuoi creare</h1>
<legend>
<h4>Tipi di documento</h4>
</legend>
<select id="modelli" name="modelli"
onChange="crea(this.options[this.selectedIndex].value,this.options[this.selectedIndex].id)">
<%
List articoli = ccb.listArticolo();
for (Iterator<Articolo> iter = articoli.iterator(); iter.hasNext();) {
Articolo articolo = iter.next();
%>
<option id="<%=articolo.getId_articolo()%>" value="<%=articolo.getDescrizione_articolo()%>"><%=articolo.getNome_articolo()%></option>
<%
}
%>
</select>
<div class="container" id="container"/>
<br />
<input type="submit" value="Avanti" onClick="mostraID()"/>
</form>
</body>
</html>
I want save me the value of javascript varible "idArticolo" in a jsp variable if it is possible.
if isn't possible how can i do to save me that value to send to the next page?
Thank you