Jump to content

quick question


dennismonsewicz

Recommended Posts

No, but you could use a hidden input:

 

<div id="test">This is a test</div>
<input type="hidden" name="test" value="This is a test">

 

And if the text inside the div was dynamic, you could use a little JavaScript to copy it to the hidden input.

Link to comment
Share on other sites

its kind of confusing but here goes...

 

Here is the code:

 

echo '<div class="left-list" id="left-list">';
	echo '<div><input type="checkbox" name="pm1" class="checkbox" id="pm1" /> <label for="pm1">PM</label></div>';
	echo '<div><input type="checkbox" name="designer1" class="checkbox" id="designer1" /> <label for="designer1">Designer</label></div>';
	echo '<div><input type="checkbox" name="pm2" class="checkbox" id="pm2" /> <label for="pm2">PM</label></div>';
	echo '<div><input type="checkbox" name="writer" class="checkbox" id="writer" /> <label for="writer">Writer</label></div>';
	echo '<div><input type="checkbox" name="pm3" class="checkbox" id="pm3" /> <label for="pm3">PM</label></div>';
	echo '<div><input type="checkbox" name="designer2" class="checkbox" id="designer2" /> <label for="designer2">Designer</label></div>';
	echo '<div><input type="checkbox" name="pm4" class="checkbox" id="pm4" /> <label for="pm4">PM</label></div>';
	echo '<div><input type="checkbox" name="christine" class="checkbox" id="christine" /> <label for="christine">Christine</label></div>';
	echo '<div><input type="checkbox" name="pm5" class="checkbox" id="pm5" /> <label for="pm5">PM</label></div>';
	echo '<div><input type="checkbox" name="designer3" class="checkbox" id="designer3" /> <label for="designer3">Designer</label></div>';
	echo '<div><input type="checkbox" name="pm6" class="checkbox" id="pm6" /> <label for="pm6">PM</label></div>';
	echo '<div><input type="checkbox" name="julie" class="checkbox" id="julie" /> <label for="julie">Julie</label></div>';
	echo '<div><input type="checkbox" name="pm7" class="checkbox" id="pm7" /> <label for="pm7">PM</label></div>';
	echo '<div><input type="checkbox" name="designer4" class="checkbox" id="designer4" /> <label for="designer4">Designer</label></div>';
	echo '<div><input type="checkbox" name="pm8" class="checkbox" id="pm8" /> <label for="pm8">PM</label></div>';
	echo '<div><input type="checkbox" name="proofreading" class="checkbox" id="proofreading" /> <label for="proofreading">Proofreading</label></div>';
	echo '<div><input type="checkbox" name="pm9" class="checkbox" id="pm9" /> <label for="pm9">PM</label></div>';
	echo '<div><input type="checkbox" name="layne" class="checkbox" id="layne" /> <label for="layne">Layne</label></div>';
	echo '<div><input type="checkbox" name="pm10" class="checkbox" id="pm10" /> <label for="pm10">PM</label></div>';
	echo '<div><input type="checkbox" name="programming" class="checkbox" id="programming" /> <label for="programming">Programming</label></div>';
	echo '<div><input type="checkbox" name="pm11" class="checkbox" id="pm11" /> <label for="pm11">PM</label></div>';
	echo '<div><input type="checkbox" name="testing" class="checkbox" id="testing" /> <label for="testing">Testing</label></div>';
echo '</div>';

 

At work we have a project board that has all of our project names and the names of the designers/project managers/marketers/whoever to see where a project is and where it as to go. They have asked me to make this into an online version. I was just trying to simplify my checking to see if any of the checkboxes had been checked verses checked each one.

Link to comment
Share on other sites

Do you have the ability to change the checkbox names? If so, this could be real easy. If not, it might be a little more complicated, but I think it's still feasible.

 

If you can change the names, I would change all of them to something like:

<?php
echo '<div><input type="checkbox" name="checkboxes[pm1]" class="checkbox" id="pm1" /> <label for="pm1">PM</label></div>';
echo '<div><input type="checkbox" name="checkboxes[designer1]" class="checkbox" id="designer1" /> <label for="designer1">Designer</label></div>';
?>

 

Then you can just do a check like this:

<?php
foreach ($_POST['checkboxes'] as $key=>$val){
  whatever...
}
?>

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.