problem with dynamic content refreshed by checking box

Status
Not open for further replies.

Busarus

New Member
I have this snippet of code... basically it display a tick box that if you check it, changes the content shown in the page

i dont want the viewer to have to check it - i want it checked by default as "only my candidates" and by extension have the relevant data shown....

any suggestions


PHP:
<form name="candidatesViewSelectorForm" id="candidatesViewSelectorForm" action="<?php echo(CATSUtility::getIndexName()); ?>" method="get">
                            <input type="hidden" name="m" value="candidates" />
                            <input type="hidden" name="a" value="listByView" />

                            <table class="viewSelector">
                                <tr>
                                    <td valign="top" align="right" nowrap="nowrap">
                                        <?php $this->dataGrid->printNavigation(false); ?>
                                    </td>
                                    <td valign="top" align="right" nowrap="nowrap">
                                        <input type="checkbox" name="onlyMyCandidates" id="onlyMyCandidates" <?php if ($this->dataGrid->getFilterValue('OwnerID') ==  $this->userID): ?>checked<?php endif; ?> onclick="<?php echo $this->dataGrid->getJSAddRemoveFilterFromCheckbox('OwnerID', '==',  $this->userID); ?>" />
                                        Only My Candidates&nbsp;
                                    </td>
                                    <td valign="top" align="right" nowrap="nowrap">
                                       <!-- <input type="checkbox" name="onlyHotCandidates" id="onlyHotCandidates" <?php if ($this->dataGrid->getFilterValue('IsHot') == '1'): ?>checked<?php endif; ?> onclick="<?php echo $this->dataGrid->getJSAddRemoveFilterFromCheckbox('IsHot', '==', '\'1\''); ?>" />
                                        <label for="onlyHotCandidates">Only Hot Candidates</label>&nbsp;-->
                                    </td>
                                </tr>
                            </table>
                        </form>
 

mahamageehad

New Member
In the <input> tag that you want already checked add the code:

checked="yes"

This will automatically tick the box
 

Busarus

New Member
no that doesnt work
i know how to check the box

as is, it operates an onclick function
if the box is checked in the code, the onclick function is not triggered
 

louie

New Member
You need a timer refresh using JavaScript to reload the content every so often.
Forget about the checkbox - use the window.onload run script
 
Status
Not open for further replies.
Top