Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checkbox name, id and value based on variable

Status
Not open for further replies.

blasterstudios

Technical User
Dec 30, 2004
128
US
I'm trying to setup a checkbox that varies depending on the value of that row in the table.

Here's what i have:
Code:
<input
    type="checkbox"
    name="<?php
        if($row_getopenjobs['status'] == "1"){
    ?>makeworking<?php
        } else { ?>makewaiting<?php
        } ?>"
    id="<?php
        if($row_getopenjobs['status'] == "1"){
        ?>makeworking<?php
        } else {
    ?>makewaiting<?php
        } ?>"
    value="<?php
        if($row_getopenjobs['status'] == "1"){
    ?>2<?php
        } else { ?>1<?php
        } ?>"
    onClick="if(this.checked) this.form.submit();">
    <?php if($row_getopenjobs['status'] == "1"){
        ?>Work in Progress<?php
        } else {
    ?>Waiting for Information<?php } ?>
 
ok, sorry, this is all about right. I simplified it, but the problem was i was using the id's when actually i should have been using the actual text.

Sorry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top