This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes populating jsp through javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply locked New topic
Author

populating jsp through javascript

Anant Rao
Ranch Hand

Joined: Nov 12, 2004
Posts: 126
Hi

I want to set value of hidden field in jsp through java script. I have array of checkbox in my jps and I want to store the value of check box in hidden field by passing the index value to javascript..

Javascript code
function check(index, propertyname, newvalue)
document.getElementById('clossProcess['+index+'].'+propertyName).value= newvalue;
}

function changeFlag(index, closeCheckBox){
var flag="no";
if (closeCheckBox)="true"{
flag="yes";
check(index,'closeFlag',false);
}

Jsp

........
"<"logic:iterate id="closeProcess name=formname property="statusList">"
<html:hidden indexed="true" name=closeprocess property=closeFlag value="no"/">"
"<"/logic:iterate

I have array of checkboxes
property name is closeFlag when i check on it will call the javascript changeFlag( '${index)$', this) and that internally will call check(index,propertyname,newvalue)
I want to set the value of checkbox in the hiddenfield.

Thanks in advance
Infynity
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63208
    
  69

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please continue any discussion of this topic in your JSP forum post.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: populating jsp through javascript
 
It's not a secret anymore!