jimsanghvi@hotmail.com Posted August 8, 2011 Share Posted August 8, 2011 Dear All what i am trying to do is when i click on the submit button and try to get the value it is not displaying it properly . I am writting the code of 2 file down 1) enable.php 2) abc.php File Name : enable.php <html> <head> <script type="text/javascript"> function showdetail(boxid){ document.getElementById(boxid).style.display = "block"; } function hidedetail(boxid){ document.getElementById(boxid).style.display = "none"; } </script> </head> <body> <form name="abc" method="post" action="abc.php"> <ul> <li><a id="r" href="#" title="" alt="" onclick="showdetail('res'); hidedetail('comm');">bb</a></li> <li style="width: 1px;">|</li> <li style="width:85px;"><a id="r" href="#" title="" alt="" onclick="showdetail('comm'); hidedetail('res');">Cc</a></li> <li style="width: 2px;">|</li> </ul> <div id="res" style="display:none;"> <select id="pr" name="pr" class="textarial12 textcolorgrey flot_left"> <option value="Hello">Hello</option> </select> </div> <div id="comm" style="display:none;"> <select id="pr" name="pr" class="textarial12 textcolorgrey flot_left"> <option value="Hi">Hi</option> </select> </div> <input type="submit" value="submit" /> </form> </body> </html> File Name : abc.php <?php $PropertyType=$_POST[pr]; echo $PropertyType; ?> [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 8, 2011 Share Posted August 8, 2011 use: $PropertyType=$_POST['pr']; (missing quotes around pr) also, you have 2 select boxes with exactly the same name, so only one will be sent through. Quote Link to comment Share on other sites More sharing options...
jimsanghvi@hotmail.com Posted August 8, 2011 Author Share Posted August 8, 2011 Thanks Richard for fast reply , but what i want to do is when submit button is clicked it get redirected to abc.php page . On this page i am storing it in a variable and then it get stored in database . So when a person click on bb click or cc click the drop down box wil change , but should store in same variable on next page . Uploading file again [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 8, 2011 Share Posted August 8, 2011 Why are you calling me Richard ? Quote Link to comment Share on other sites More sharing options...
jimsanghvi@hotmail.com Posted August 8, 2011 Author Share Posted August 8, 2011 Sorry i thought your name is richard , but i think you have written proverb under your photo , so i got confused Quote Link to comment Share on other sites More sharing options...
WebStyles Posted August 8, 2011 Share Posted August 8, 2011 Man, Richard Feynman is dead. I'm still alive. have you made the changes I suggested in my first post? what went wrong? what errors do you get now? if you want the value to persist when you go back to the initial page, you can store it in a $_SESSION var. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.