Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML JavaScript

onChange using Javascript and PHP doesn't work for me...

Javascript coding ..

Moderators: macek, egami, gesf

onChange using Javascript and PHP doesn't work for me...

Postby epicunion » Mon Aug 11, 2003 12:03 am

...I have used this script by itself and it works fine(without PHP that it); it actually sends the variable when you select an option.

However when I put this into a PHP page to use as a rating system (the variable would be added to a database eventually) it won't submit the form. I am baffled by this and have tried everything in my power to try and get the page to reload when selecting a drop-down option.

Has anyone had any experience with this problem before? Any alternatives? Thanks in advance.

Code: Select all
<form name="rankForm" method="get" action="artists.php">
<select name="userRating" onChange=rankForm.submit()>
                  <option value=""></option>
                  <option value="10">10</option>
                  <option value="9">9</option>
                  <option value="8">8</option>
                  <option value="7">7</option>
                  <option value="6">6</option>
                  <option value="5">5</option>
                  <option value="4">4</option>
                  <option value="3">3</option>
                  <option value="2">2</option>
                  <option value="1">1</option>
</select>
</form>
[/code]
epicunion
New php-forum User
New php-forum User
 
Posts: 3
Joined: Thu Jul 17, 2003 10:24 pm
Location: Portland, OR

Postby Oleg Butuzov » Mon Aug 11, 2003 1:03 am

Code: Select all
<select name="last" onchange="window.location=('somephp.php?s=&showlast='+this.options[this.selectedIndex].value)">
<option value="1" >1</option>
<option value="2" >2</option>
<option value="5" >5</option>
<option value="10" >10</option>
</select>
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Re: onChange using Javascript and PHP doesn't work for me...

Postby swirlee » Mon Aug 11, 2003 6:12 am

epicunion wrote:Has anyone had any experience with this problem before? Any alternatives?


I hate to be Captain Obvious, but.. how about a submit button?
User avatar
swirlee
Moderator
Moderator
 
Posts: 2272
Joined: Sat Jul 05, 2003 1:18 pm
Location: A bunk in the back

Re: onChange using Javascript and PHP doesn't work for me...

Postby WiZARD » Mon Aug 11, 2003 7:17 am

swirlee wrote:
epicunion wrote:Has anyone had any experience with this problem before? Any alternatives?


I hate to be Captain Obvious, but.. how about a submit button?

he-he-he :lol:
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol


Return to JavaScript

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.