Click here to Skip to main content
15,902,938 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
PHP
 <?php
                class combobox extends Status
                {
                     function showTextBox()     
                     {
                         if (Status.$id != 3)
                         {
                              echo '<td><span class="required">*</span> Reward (<span class="style1">Optional</span>):</td>
                              <td><input name="reward" type="text" id="reward" /></td>';
                         }       
                     }
                     
                }
                   $combo = new combobox();
                   $combo.showTextBox();
//              ?>


Good Day all

The above code is suppose to hide or show a textbox based on the selection made in the dropdown. however i am having an error saying the function is not define. please help
thanks in advance
Regards
Posted
Comments
Sergey Alexandrovich Kryukov 1-Mar-13 14:40pm    
Which function..?
—SA
Georges23 1-Mar-13 14:44pm    
the showTextBox() Function

1 solution

Status.$id has no meaning in php. If you want to reference the parent's hidden fields, you should use parent::. But in your case, I suppose you should use $this->id.
But as I see, you have bigger problems. From what you have posted, you have serious software design flaws...
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900