Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Client Side Scripting
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 05-30-2005, 02:21 PM
  #1
expinch
Paladin (Level 15)
 
Join Date: Apr 2004
Posts: 384
iTrader: (0)
expinch is on a distinguished road
Using a <select> "onchange" to submit

I have a form that I'd like to submit as soon as a value inside of it is changed. I have the following:

[html]
<form method="post" action="stats.php" name="teamList">
<select name="teamlist" onchange="window.location.href=stats.php">
<option value="35" selected="selected">Adrenaline Junkies</option>
<option value="9">Bad Boys</option>
<option value="6">Bad Buicks</option>
<option value="18">Bluestreaks</option>
<input type="hidden" name="week" value="11"></input>
<input type="hidden" name="stattype" value="1"></input>
<input type="hidden" name="stattable" value="0"></input>
</select>
</form>
[html]

As you can see I tried to use the window.location.href to accomplish the task but its not working. The page that I want to re-direct to is t he current page that I'm on (i'm using php), but I want to make sure all of my form data is passed, including the hidden inputs at the end. Any help would be appreciated, thanks!
expinch is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 05-30-2005, 02:43 PM
  #2
IKLOP
Deity (Level 17)
 
Join Date: Mar 2002
Location: Charlottesville, VA
Posts: 869
iTrader: (0)
IKLOP is on a distinguished road
instead of doing window.location.href=stats.php do document.teamList.submit(); to submit the form and send the data associated with it. using window.location.href will just change the page without actually submitting anything.

and to display html code use the code tags: [code]code here[/code]
__________________
Tabbed Source: firefox extension to open page source in a new tab instead of a new window
HTMexceL: display your mysql tables with excel style scrolling

"Some of us are trying to do work...hypothetically." -Wally - Dilbert
IKLOP is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 05-30-2005, 04:36 PM
  #3
expinch
Paladin (Level 15)
 
Join Date: Apr 2004
Posts: 384
iTrader: (0)
expinch is on a distinguished road
That worked perfect, thanks IKLOP.
expinch is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
KEEP TABS
SPONSORS
 
Boxedart

 
 


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  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
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 06:52 PM.

   

Mascot team created by Drawshop.com | Web Hosting

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.