NZGames.com Forums
Register FAQ Calendar Mark Forums Read

Go Back   NZGames.com Forums > General > Coders' Forum
User Name
Password

Reply
 
Thread Tools
Old 20th May 2013, 14:18     #1
MadMax
Stuff
 
ONCHANGE= only working in IE

Code:
<P><FORM method="GET" action="/timesheet/enter_times.php" NAME="pp"> <label for="pay_period">Select the pay period to enter hours for:</label><br> <SELECT id="pay_period" NAME="pay_period" ONCHANGE="document.pp.submit()"> <OPTION VALUE="1368360000" >May 13, 2013 -> May 19, 2013</OPTION> <OPTION VALUE="1368964800" SELECTED>May 20, 2013 -> May 26, 2013</OPTION> </SELECT> </FORM>
^ some really old code that is still in use, I'm guessing it only works in IE because it just ignores whatever coding issue there is. Toggling the week in the OPTION is supposed to change (submit) the page.
__________________
My degree of sarcasm depends on your degree of stupidity.

Last edited by MadMax : 20th May 2013 at 14:19.
  Reply With Quote
Old 20th May 2013, 15:38     #2
crocos
 
This might help - not sure, haven't watched.
http://www.youtube.com/watch?v=7O9K_ULKOzU

Also the W3 reference page:
http://www.w3.org/TR/WCAG20-TECHS/SCR19
__________________
Ξ √ Ω L U T ↑ ☼ N

وكل يوم كنت تعيش في العبودية

Last edited by crocos : 20th May 2013 at 15:43.
  Reply With Quote
Old 20th May 2013, 15:53     #3
crocos
 
Hmm... this might be better - basically a question & response on how to submit a form on-change from a Select:
http://stackoverflow.com/questions/1...-a-form-to-php

In short, in the onChange call out to a Javascript function rather than trying to submit directly from the form.
__________________
Ξ √ Ω L U T ↑ ☼ N

وكل يوم كنت تعيش في العبودية

Last edited by crocos : 20th May 2013 at 15:55.
  Reply With Quote
Old 20th May 2013, 21:20     #4
Farmer Joe
Word To Your Motherboard!
 
Code:
<form method="GET" action="/timesheet/enter_times.php" name="pp" id="pp"> <label for="pay_period">Select the pay period to enter hours for:</label><br> <select id="pay_period" name="pay_period" onchange="document.getElementById('pp').submit();"> <option value="1368360000" >May 13, 2013 -> May 19, 2013</option> <option value="1368964800" selected="selected">May 20, 2013 -> May 26, 2013</option> </select> </form>
Note: Added id to form and used document.getElementById to get, then submit it.

Last edited by Farmer Joe : 20th May 2013 at 21:24.
  Reply With Quote
Old 20th May 2013, 21:44     #5
MadMax
Stuff
 
^ epic. With any luck I'll give it a go tomorrow
__________________
My degree of sarcasm depends on your degree of stupidity.
  Reply With Quote
Old 20th May 2013, 21:52     #6
crocos
 
Bloody FarmerJoe coming in with elegant and relevant solutions.

You fucking guy! You kick my dog!
__________________
Ξ √ Ω L U T ↑ ☼ N

وكل يوم كنت تعيش في العبودية
  Reply With Quote
Old 22nd May 2013, 14:08     #7
Farmer Joe
Word To Your Motherboard!
 
Quote:
Originally Posted by crocos
Bloody FarmerJoe coming in with elegant and relevant solutions.

You fucking guy! You kick my dog!
haha
  Reply With Quote
Old 23rd May 2013, 17:28     #8
EvilLumpy
 
this.form.submit() should do the trick without needing to add any id's.

If you've got the willpower, jquery would fix it all for ya.
  Reply With Quote
Old 23rd May 2013, 23:41     #9
crocos
 
Quote:
Originally Posted by EvilLumpy
this.form.submit() should do the trick without needing to add any id's.

If you've got the willpower, jquery would fix it all for ya.
You sure? "this" would refer to the Select, which does not have a form attribute.
__________________
Ξ √ Ω L U T ↑ ☼ N

وكل يوم كنت تعيش في العبودية
  Reply With Quote
Old 1st August 2013, 11:32     #10
MadMax
Stuff
 
Code:
<FORM method="GET" action="/timesheet/enter_times.php" NAME="pp" id="pp"> <label for="pay_period">Select the pay period to enter hours for:</label><br> <SELECT id="pay_period" NAME="pay_period" ONCHANGE="document.getElementById('pp').submit();"> <OPTION VALUE="{$week1}" {if $pay_period==$week1}SELECTED{/if}>{$week1|date_format} -> {$week1_end|date_format}</OPTION> <OPTION VALUE="{$week2}" {if $pay_period==$week2}SELECTED{/if}>{$week2|date_format} -> {$week2_end|date_format}</OPTION> </SELECT> </FORM>
is what I've changed it to (and have supplied code from the php rather than from the browser), however still the same result
__________________
My degree of sarcasm depends on your degree of stupidity.
  Reply With Quote
Old 1st August 2013, 11:45     #11
MadMax
Stuff
 
Quote:
Originally Posted by EvilLumpy
this.form.submit() should do the trick without needing to add any id's.
Quote:
Originally Posted by crocos
You sure? "this" would refer to the Select, which does not have a form attribute.
yeah, result is it stops working completely
__________________
My degree of sarcasm depends on your degree of stupidity.
  Reply With Quote
Old 1st August 2013, 18:23     #12
Farmer Joe
Word To Your Motherboard!
 
Quote:
Originally Posted by MadMax
Code:
<FORM method="GET" action="/timesheet/enter_times.php" NAME="pp" id="pp"> <label for="pay_period">Select the pay period to enter hours for:</label><br> <SELECT id="pay_period" NAME="pay_period" ONCHANGE="document.getElementById('pp').submit();"> <OPTION VALUE="{$week1}" {if $pay_period==$week1}SELECTED{/if}>{$week1|date_format} -> {$week1_end|date_format}</OPTION> <OPTION VALUE="{$week2}" {if $pay_period==$week2}SELECTED{/if}>{$week2|date_format} -> {$week2_end|date_format}</OPTION> </SELECT> </FORM>
is what I've changed it to (and have supplied code from the php rather than from the browser), however still the same result
That doesn't look like any PHP code I've ever seen?
  Reply With Quote
Old 26th June 2014, 15:22     #13
MadMax
Stuff
 
PEAR + Smarty
__________________
My degree of sarcasm depends on your degree of stupidity.
  Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



© Copyright NZGames.com 1996-2023
Site paid for by members (love you guys)