sakush100 0 Newbie Poster

MY JAVASCRIPT TO SUBMIT A FORM INSIDE AN IFRAME

<script>
function fsubmit(g){
window.frames.[g].document.g.submit();
}
</script>

MY PHP CODE TO GENERATE HTML

echo'<a onclick="fsubmit('.$nayaid.'99999)" href="#"><img border="0" src="images/close_small.png" width="10" height="9" title="Ignore '.$fnam.' '.$lnam.'"></a></font></b></td></tr></table></td></tr></table><span style="font-size: 8pt">&nbsp;<br></span></div><div style=\'display:none\'><iframe name="'.$nayaid.'99999" id="'.$nayaid.'99999" src="frames/ignore.php?id='.$nayaid.'" width="1" height="1"></iframe></div>'

onclick event supplies a value in the javascript on clicking the image. this value is name, id of the iframe as well as its the name and id of the form that was loaded inside the form. Whenever i click, the form inside the iframe should be submitted. I dont know whats wrong..... but i think its something in javascript syntax or declaration.