0

So i've updated the codes. i'm trying to make a radio box so when yes is checked on the radio box a textbox appears using angular.js hoping it would work.

<div ng-app="">
 <div class="form-group">
    <label class="control-label col-sm-2">Experience:</label>
      <div class="col-sm-2">
        <input type="radio" name="emp_experience"  ng-model="experience" value='
                    <div class="form-group">
                  <label class="control-label col-sm-2">Experience Years:</label>
                  <div class="col-sm-4">
                    <input type="text" name="emp_exp_y" class="form-control" placeholder="Years"> 
                  </div>
                </div>'
     required />Yes
      </div>
      <div class="col-sm-2">
        <input type="radio" name="emp_experience"  ng-model="experience" value=" " required />No
      </div>
    <?php $a = "{{experience}}";
    echo <<<EOD $a
EOD;
?>
  </div>
</div>

I want the output to generate a textbox when yes is clicked but all I get is the code itself

<div class="form-group"><div class="col-sm-4"><input type="text" name="emp_exp_y" class="form-control" placeholder="Years"> </div></div>
  • 1
    Your code is working for me. As a side note, the EOD stuff is unnecessary. You can just do "echo $a;" and it works the same. Throw your code in a site like phpfiddle.org, you'll see it's working fine. Whatever is causing the issue is not in the code you posted. – Skeets Sep 09 '16 at 10:56
  • You're not using the `heredoc` correctly. You need to place `<< – DarkBee Sep 09 '16 at 11:41

0 Answers0