I have a JSP page on which I have buttons input submit. Now, based on some of the values that I get from the request AJAX, I want to control display and hiding of these input buttons. Therefore, I created spansfor each input. And based on the value of the variable that I received from the AJAX request, I manipulate the display property there. But I do not get the results correctly.
here is my code:
<td style="width: 600px"><span id="startspan"><input name="start" value="startActivity" type="submit" id="startbuttonid"></span></td>
<td style="width: 600px"><span id="holdspan"><input name="start" value="holdActivity" type="submit" id="holdbuttonid"></span></td>
<td style="width: 600px"><span id="cancelspan"><input name="start" value="cancelActivity" type="submit" id="cancelbuttonid"></span></td>
<td style="width: 600px"><span id="closespan"><input name="start" value="closeActivity" type="submit" id="closebuttonid"></span></td>
And my code java script, where I write code to show or hide them:
if(temp1[15]=="InProcess"){
document.getElementById('startspan').style.display='none';
document.getElementById('holdspan').style.display = 'block';
document.getElementById('cancelspan').style.display = 'block';
document.getElementById('closespan').style.display = 'block';
}
if(temp1[15]=="New"){
document.getElementById('startspan').style.display='block';
document.getElementById('holdspan').style.display = 'none';
document.getElementById('cancelspan').style.display = 'block';
document.getElementById('closespan').style.display = 'none';
}
, temp1[15], . . , . dialog box <div>, , , ( ). . .