Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts

    cannot get value from chained selectbox

    i am using chained selectbox in http://www.dynamicdrive.com/dynamici...ects/index.htm


    sample.html

    Code:
    <html>
    
    <head>
    <title>Chained Selects</title>
    <script language="javascript" src="chainedmenu.js"></script>
    <script language="javascript" src="config.js"></script>
    </head>
    <body onLoad="initListGroup('chainedmenu', document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel, 'savestate')">
    
    <form name="listmenu0" action="x2.php" method="REQUEST">
    <table align="center">
    	<tr>
    		<td><select name="firstlevel"></select></td>
    		<td><select name="secondlevel"></select></td>
    		<td><select name="thirdlevel"></select></td>
    		<td>
    			<input type="button" value="Go" onClick="goListGroup(document.listmenu0.firstlevel, document.listmenu0.secondlevel, document.listmenu0.thirdlevel)">
    			<input type="button" value="Reset" onClick="resetListGroup('chainedmenu')">
    			<input name="" type="submit" value="Submit">
    		</td>
    	</tr>
    </table>
    </form>
    </body>
    
    </html>
    x2.php
    PHP Code:
    <?php
    foreach($_REQUEST as $a=>$b){
        echo 
    $a." -  ".$b."<br/>";
    }

    ?>
    i can get just last selectbox value but i wanna get three selectbox value

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Can you post a link to your page? We need to see what is being generated by the chained select script.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,546
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Aerospace's request first, but also... request is not a valid method type, it should be post or get (your form element). Request is a PHP super variable that lets you access GET and POST with a single call, but shouldn't be used. If you're using post, use _POST, if you're using get, use _GET. If you use _REQUEST, someone can easily trick your system by putting in a variable into the url as a get variable and screw with your program. The fact that you're using an invalid method type might be screwing with everything.

  • #4
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts
    my codes is in attachment
    Attached Files Attached Files

  • #5
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    Have you no options in the select?
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #6
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Read what the functions actually do.

    http://www.dynamicdrive.com/dynamici...ainedmenu.html

    The third parameter of addOption and addList is the value of the option you are adding. You set these to "" so there will be no value which is why you aren't getting them in php.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •