-1

I have the following code:

<input type="text" name="firstName" id="firstName" value=" <?php setValue( "firstName" ) ?> " />

The problem is, the value attribute reaches the first quote <?php setValue( as a value of the input field. How to deal with it?

Ofelia Muradova
  • 127
  • 3
  • 17

3 Answers3

2

Try concat :

<input type="text" value="' . <?php setValue('firstName') ?> . '"/>
C0ZEN
  • 894
  • 11
  • 41
2

You could use an echo this way

<?php echo  '<input type="text" name="firstName" id="firstName" value="'.  
                 setValue( "firstName" ). '" />' ; ?>
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
1

I think your data is return firstName value or whatever by function setValue. You have to echo your value that is

<input type="text" name="firstName" id="firstName" value=" <?php echo setValue( "firstName" ) ?> " />

and your code is correct. Than use

<?php echo  '<input type="text" name="firstName" id="firstName" value="'.  
             setValue( "firstName" ). '" />';  ?>
Kumar
  • 1,187
  • 18
  • 31