I think I have a solution for your code block...it took a little bit of work to figure out what Caja didn't like but here's the code:
CODE
<form name="formlist" id="formlist" action="yap_12.php" method="post">
<input id="NextAc" type="hidden" name="NextAc" value="">
<select name="xballarea" onChange="DataSend('formlist','Select1');return false;">
<option value='test1'>test 1</option>
<option value='test2'>test 2</option>
</select>
<input name="image" type="image" onClick="DataSend('formlist','Select1')" src="http://www.golfly.com.tw/chinese/_img/03_admin/icon_ok.jpg">
</form>
<script>
function DataSend(obj,FormData){
if(FormData != ""){
document.getElementById('NextAc').value = FormData;
}
document.getElementById(obj).submit();
return true;
}
</script>
Caja's still pretty new so you may run into similar issues along the way, but there were a few takeaways:
- Cajoled code is a tame code model, and referencing document.formName seems to have some issues.
- I switched some of the data to an id capture structure (getElementById) as it seems to work best currently against Caja
Hopefully everything should be good with that block.
Jonathan LeBlanc
Senior Software Engineer
Yahoo! Developer Network