How can I utilize Java Beans and session beans to store user input data and display a preview of the entered details on the next page? I have already created a servlet using JSP, but now I want to incorporate Java Beans to showcase the form data. How should I go about achieving this?
window.onload = function() {
document.getElementById("b1").onmouseover = function() {
this.style.backgroundColor = "yellow";
}
document.getElementById("b1").onmouseout = function() {
this.style.backgroundColor = "#9999ff";
}
}
function validateForm() {
var x = document.forms["myform"]["pname"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
}
* {
box-sizing: border-box;
}
<div class="row">
<div class="column left" style="background-color:#aaa;">
<form name="myform" action="display.jsp" method="post" onsubmit="return validateForm()">
Product Name: <input type="text" name="pname"><br> Quality: <br>
<input type="radio" id="Excellent" name="quality" value="Excellent">
<label for="Excellent">Excellent</label><br>
<input type="radio" id="Very Good" name="quality" value="Very Good">
<label for="Very Good">Very Good</label><br>
<input type="radio" id="Good" name="quality" value="Good">
<label for="Good">Good</label><br>
<input type="radio" id="Fair" name="quality" value="Fair">
<label for="Fair">Fair</label><br><br>
<input type="submit" name="submit" id="b1">
</form>
</div>
<div class="column right" style="background-color:#bbb;">
<div class="vertical-menu">
<a href="#">Product Feedback</a>
<a href="home.html">Home</a>
</div>
</div>
</div>