Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to use request.getParameter("value") within javascript function

843838Mar 4 2007 — edited Mar 5 2007
I have this particular requirement that on my jsp page, i am getting some parameters set by controller servlet and i need to get the values of these parameteres within my java script function so that i can set the values of my form elements and submit it.

here is the incomplete code snippet :


<% if ( "edit button".equals (hello) ) {%>
<script language="javascript">
window.alert ("in if part");
var val1 = "<%=request.getAttribute("FirmwareVersion")%>";
var val2 = "<%=request.getAttribute("SoftwareProduct")%>";
var val3 = "<%=request.getAttribute("SoftwareVersion")%>";
var val4 = "<%=request.getAttribute("SoftwareOperatingSystem")%>";

putValue (val1, val2, val3, val4);
</script>
<%}<%>

function putValue ( var1, var2, var3, var4) {

document.createUpdateForm.productSoftwareProduct.value = val2;
document.createUpdateForm.productSoftwareVersion.value = val3;
document.createUpdateForm.productSoftwareOperatingSystem.value = val4;
document.createUpdateForm.productFirmwareVersion.value = val1;
}


and then i am submitting the form in another function.

any leads???

regards.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 2 2007
Added on Mar 4 2007
2 comments
897 views