Page 1 of 1
JS button click delimma
Posted: Mon Dec 01, 2003 10:41 am
by gator
I would like my submit button (named "filter") in my left frame to automatically fire (or be pressed)
after the submit button in my right frame has been pressed
This was my feeble attempt:
Code: Select all
<body onload="window.document.formsї0].filter.click">
Posted: Mon Dec 01, 2003 11:33 am
by microthick
<input type="button" name="buttoninrightframe" onClick="document.parent.frames["leftFrameName"].document.formName.submit();" value="Submit!">
something like that maybe?
Posted: Mon Dec 01, 2003 1:19 pm
by gator
Thanks for the promp reply.
I think I'm getting there, I did what you stated but it no-worki
Changing my 'submit' button to 'button' does nothing.
I changed it back to 'submit' and it just submitted the info to the db just fine.
However it didn't press my "Filter" (submit) button on my left frame.
Code: Select all
<input type="submit" name="update" onClick="document.parent.framesї"contents"].document.todo_filter.filter();" value="Update">
Posted: Mon Dec 01, 2003 1:23 pm
by microthick
What is the action of the "todo_filter" form?
And do you have any JavaScript bound to the "filter" submit button right now?
Posted: Mon Dec 01, 2003 3:09 pm
by gator
action="todo.php" - points to 'todo.php' which uses $filter to filter the form in the right frame.
no JS bound to filter
<INPUT TYPE="SUBMIT" NAME="filter" VALUE="Filter">
Posted: Mon Dec 01, 2003 3:18 pm
by microthick
So, if we submit the form in the left frame, it will do what we want, right? It isn't necessary to press the Filter button since all that is doing is submitting the form anyway, right?
Code: Select all
<input type="submit" name="update" onClick="document.parent.framesї"contents"].document.todo_filter.submit();" value="Update">
Should submit the todo_filter form when you press on the "Update" button.
Posted: Mon Dec 01, 2003 3:27 pm
by microthick
If it doesn't work, then I suggest waiting for Gen-ik or someone else to answer. Gen-ik's pretty good at this stuff.
Posted: Mon Dec 01, 2003 3:48 pm
by gator
Thats a great point, and it made me wonder why I was pointing to 2 different php docs. I simply added the 'filter' code next to my 'update' and 'delete' code which eliminates the need for a JS onClick event.
I spoke to soon. I consolidated the code but I still need an 'onClick' or maybe even an 'onLoad' event to automatically click the filter button.
This was my latest attempt:
Code: Select all
<input type="submit" name="update" onClick="document.parent.framesї"contents"].document.todo_filter.submit();" value="Update">