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?
[code=php]
button:
<input type=”image”
id=”search”
src=”include/searchBlue89x33.gif”
name=”search”
class=”btn”
onmouseover=”this.className=’btn-on’;”
onmouseout=”this.className=’btn’;”
onClick=”actionListener()”>
[code=php]
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();
}
}
[code=php]
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!
camokat