Jump to content

onclick - should change name in drop down


Recommended Posts

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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.