I have the following script:
if( condition ){
echo '<form action="url" name="myForm" method="post">';
echo '<input type="hidden" name="val" value="yes">';
echo '<input type="submit" name="Ok" value="Ok">';
echo '</form>';
}
When the condition is met,the submit button will show up,and i want it to be clicked with javascript,so the form will be submitted and i can use the hidden post value on the page from the action url."
I tried to add an id for the submit button and then use click(); but is not working.I also tried to create a function and use this.form.submit but it doesnt work because the action take place before the hidden value can be send.Any ideas?
includea script with the functions you need and then call them directly.