setting value of hidden field

liunx

Guest
I have a series of buttons that are attached to a JavaScript. When button is pressed condition statements are executed and form is submitted. In form I have a hidden field 'actionType' that needs to be set to a value of the button when form is submitted. The problem is that value of 'actionType' is never set. What's the problem?

button:
<input type="image"
id="search"
src=http://www.webdeveloper.com/forum/archive/index.php/"include/searchBlue89x33.gif"
name="search"
class="btn"
onmouseover="this.className='btn-on';"
onmouseout="this.className='btn';"
onClick="actionListener()">


JavaScript:
function actionListener(){
var command = window.event.srcElement.id;
var isSubmitOK = true;
if(command == 'search'){
showWait();
document.body.style.cursor = "wait";
document.gesForm.add.disabled = true;
document.gesForm.search.disabled = true;
document.gesForm.clear.disabled = true;
document.gesForm.cancel.disabled = true;
}
if(isSubmitOK){
document.getElementByName('actionType').value = command;
document.getElementById('ges').submit();
}
}


JSP page:
<input type='text' class='input' id='coln' name='coln' size='30' value='' onFocus="this.select()" maxlength='30'>

<input type="hidden" name="tableName" value="color_1">
<input type="hidden" name="actionType" value="">
<input type="hidden" name="dataSize" value="0">
<input type="hidden" name="buttonLayout" value="include/buttons/default">


thanks for your help!
camokatoops, need to move it to JavaScript.Did you try the setValue() method?

I'm not sure its in JS, but I'm fairly positive it is in JSP....
 
Back
Top