Link to home
Start Free TrialLog in
Avatar of JohnMac328
JohnMac328Flag for United States of America

asked on

CF - One form value fills another field value

Right now it is manually done and does work.  I would like the credit earned field to automatically fill in either 1 or 0 based on the value in test status, either passed or Failed.  Any help is appreciated.
<tr>
         <td><select name="Test_Status">
            <option value='1'#UserPass#>Passed</option>
            <option value='0'#UserFail#>Fail</option>
        </select></td>
        <td><cfinput type="datefield" name="Test_Date"></td>
        <td><select name="Credits_Earned" class="widthed">
            <option value='0'>0</option>
            <option value='1'>1</option>
            </select></td>
      </tr>

Open in new window

Avatar of erikTsomik
erikTsomik
Flag of United States of America image

can u be more specific for what r u trying to do
Avatar of JohnMac328

ASKER

When the value of test status is selected, either a 1 or 0, then based on that the credit field will fill in with a 1 or 0

1 = Passed and then the credit field will be 1 and the opposite for Failed which is 0
i would do it with javascript
take a look at this here
http://www.plus2net.com/javascript_tutorial/dropdown-list-demo.php
The link example does not work.  When the category value is selected, the sub cat value never changes.
it does work . at least it will give you an idea how to do it . just right click on the screeen and select View Source
I did copy the source, I was curious why the value in the second drop-down never changed when the value in the first drop-down is selected.  I will put it in and see what happens.
Subcat dropdown never changes value
ASKER CERTIFIED SOLUTION
Avatar of trailblazzyr55
trailblazzyr55

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great, thanks
Avatar of trailblazzyr55
trailblazzyr55

Glad I could help, thanks!