Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-02-2011, 05:58 PM   PM User | #1
phpcodelearner
New Coder

 
Join Date: Feb 2010
Posts: 50
Thanks: 5
Thanked 1 Time in 1 Post
phpcodelearner is an unknown quantity at this point
dropdown box show div

hi every one i have searched the internet and tried many methods but i can get any of them to work
what i want to do is:
when completed is selected in a drop down box it shows a div tag
i have this currently but it is not working
Code:
<script>
function showDiv(value){
 var state = document.getElementById(email_choice).style.display;
 
 if (value == '1'){
	document.getElementById(email_choice).style.display = 'block';
 }else{
 	document.getElementById(email_choice).style.display = 'none';
 }
 
 }
</script>

<form action="<?php echo $editFormAction; ?>" method="POST" name="form3">

<select name="status" onchange="showDiv(this.value);">
      <?php
do {  
?>
      <option value="<?php echo $row_job_status['id']?>"<?php if (!(strcmp($row_job_status['id'], $row_job['status']))) {echo "selected=\"selected\"";} ?>><?php echo $row_job_status['status']?></option>
      <?php
} while ($row_job_status = mysql_fetch_assoc($job_status));
  $rows = mysql_num_rows($job_status);
  if($rows > 0) {
      mysql_data_seek($job_status, 0);
	  $row_job_status = mysql_fetch_assoc($job_status);
  }
?>
    </select>


<div id="email_choice" style="display: none">    
 {check box here}
</div>


</form>
i am sorry for the php in there! just ignore it
that is a cut down version of my page the relivent infomation is there.

summary

when completed is selected in the drop down box the div email_choice shows it content

that is it

thanks you very much for your time
phpcodelearner is offline   Reply With Quote
Old 03-03-2011, 07:36 AM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
document.getElementById(email_choice)
That should be
Code:
document.getElementById("email_choice")
(or within single quotes)
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:48 AM.


Advertisement
Log in to turn off these ads.