borrow me your eye.

Hi, when i press the "Set Priority" in this page, it's not able to pass the user_action value to the servlet. i wonder why. I can repeat (can pass) by press others button.. on man.. this is killing me...

<html>

<head>
<script language = "javascript">

function IncidentSubmit() {
      document.incident_main.user_action.value="incident_details";
}

function caseFile() {
      document.incident_main.action = "caseFile";
      document.incident_main.user_action.value="caseFile";
}

function p_case() {
      document.incident_main.user_action.value="priority";
}


function checkRadios() {
 var el = document.forms[0].elements;
 for(var i = 0 ; i < el.length ; ++i) {
  if(el[i].type == "checkbox") {
   var radiogroup = el[el[i].name]; // get the whole set of radio buttons.
   var itemchecked = false;
   for(var j = 0 ; j < radiogroup.length ; ++j) {
    if(radiogroup[j].checked) {
       itemchecked = true;
       break;
      }
   }
   if(!itemchecked) {
    alert("Please choose an Incident.");
    if(el[i].focus)
     el[i].focus();
      return false;
   }
  }
 }
 return true;
}

function checkRadiosCase() {
 var el = document.forms[0].elements;
 for(var i = 0 ; i < el.length ; ++i) {
 
  if(el[i].type == "checkbox") {
   var radiogroup = el[el[i].name]; // get the whole set of radio buttons.
   var itemchecked = false;
   for(var j = 0 ; j < radiogroup.length ; ++j) {
    if(radiogroup[j].checked) {
       itemchecked = true;
       break;
      } // end if
   } // end for
   
   if(!itemchecked) {
    alert("Please choose an Incident.");
    if(el[i].focus)
     el[i].focus();
      return false;
   } // end if
  } // end if
 
 }//end for
 return true;
}



</script>
</head>
<body>
<%
List incidentList = (List)session.getAttribute("incidentList");
List userList = (List)session.getAttribute("all_user");

String pid = (String)session.getAttribute("profile_id");
%>
<form name="incident_main" method="post" action="incident" onsubmit="return checkRadios(this);">

<table border="0"  cellpadding="2" width="100%">
 
<tr>
<td>No</tD>
<td>&nbsp; </td>
<td>Incident ID</td>
</tr>

<%
int counter=0;
for (int i=0; i<incidentList.size(); i++) {
      IncidentObject io = (IncidentObject) incidentList.get(i);
counter++;
%>
<tr>
<td><%= counter %></td>
<td><input type="checkbox" name="iid" value="<%= io.getIid() %>"> </td>
<td><%= io.getIid() %></td>
</tr>
<%
}
%>

</table>



<input type="hidden" name="user_action" >
<br>
<select name="target_user">
<option value=""> Please Select User here ... </option>
<%
for (int x=0; x<userList.size(); x++) {
      userObject uo = (userObject)userList.get(x);
%>
      <option value="<%= uo.getUid() %>"><%= uo.getUser_name() %> ( <%= uo.getUid()%> )</option>
<%
}
%>
</select>


<input type="hidden" name="profileid" value="<%= pid %>" >
<input type="submit" value="Assign to Case File" onClick="caseFile();" >


<br><BR><BR>
<input type="submit" value="Incident Details" onClick="IncidentSubmit();" >
<input type=button value="Back" onClick="history.go(-1)">
<input type="hidden" name="user_action">
<br><BR><BR>

<select name="priority">
      <option value=""> Set Priority Here </option>
      <option value="LOW">LOW</option>
      <option value="MEDIUM">MEDIUM</option>
      <option value="HIGH">HIGH</option>
</select>
<input type="hidden" name="test" >
<input type="submit" value="Set Priority" onClick="p_case();" >

</form>
</html>
xman19Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
what does your servlet code look like:
0
objectsCommented:
or is the servlet not getting called?
0
KuldeepchaturvediCommented:
you have two user_action fields in your form...! thats why its behaving erraticly..

>>>
<input type="hidden" name="user_action" >
<br>

and
>>><input type=button value="Back" onClick="history.go(-1)">
<input type="hidden" name="user_action">
<br><BR><BR>


Delete one of them & try again..
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

xman19Author Commented:
object, the sevlet is called but then it's cant get the "user_action"

Kuldeep, the user_action appear twice is not the cause of this issues. i have tired to remove one and it's still cant get the user_action.

I think is the html problems, as i have been doing this for many time. but now i can't locate tjhe problemativ code.
0
xman19Author Commented:
or in short, where should i put this code?
<input type='hidden' name="user_action">
0
KuldeepchaturvediCommented:
normally I keep all my hidden variables at the bottom of the page.. just above the closing form tage..

in the servlet when you try to get user_action what value do you get?

in HTML if you have same variable twice.. it creates a array for that variable... ( I have faced that problem more than twice...)..
thats why I asked you to remove one...

also in your javascript function  p_case()  put an alert, just to make sure that its being called...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
xman19Author Commented:
you are right. it's sovled. doouble user_action.
0
KuldeepchaturvediCommented:
glad to be of help...:-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.