I am using javascript function in my mako template. i need to return a
variable value to a
pylon controller. please let me know how I can do this...
<SCRIPT LANGUAGE="JavaScript">
function setvariable(action_name) {
//alert("hello");
alert(action_name);
arr="";
//alert(document.forms[0].elements.length);
//alert(document.forms[0].searchuser_id[0].value);
for(i=3; i<document.forms[0].elements.length; i++){
//alert(document.forms[0].elements[i].name)
//alert(document.forms[0].elements[i].value)
if(document.forms[0].elements[i].type == "checkbox" && document.forms
[0].elements[i].checked){
arr = arr + document.forms[0].elements[i+1].value + ',' ;
}
}
if( action_name=="AddUser" ) {
document.forms[0].action = "/admin/manageuser_AddUser_Clicked";
}
else if( action_name=="DeleteUser" || action_name=="ModifyUser"){
if (arr == "") {
alert("You need to select a record for Action : " + action_name);
return false;;
}
else if(arr != "" && action_name=="DeleteUser" ) {
alert(arr);
c.array=arr;
document.forms[0].action = "/admin/manageuser_DeleteUser_Clicked";
}
else if(arr != "" && action_name=="ModifyUser" ) {
alert(arr);
c.array=arr;
document.forms[0].action = "/admin/manageuser_ModifyUser_Clicked/{1}";
<--how to pass value to controller here
}
}
}
</SCRIPT>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---