Reputation: 17
I'm simply echoing a user's info in an HTML form as "value=". Everything is working perfectly except the phone number. Here is my current code:
<div class="sign-in-btn">
<input type="phoneNumber" data-mask="(000) 000-0000" name='User_phonenumber' id='User_phonenumber' value=<?php echo $phone;?> />
</div>
Only the area code appears - ie (908). The phone number is formatted in the db as (xxx) xxx-xxxx.
I feel it has something to do with the form because it echos perfectly when done outside the form. For example, the full number (with formatting) echos perfectly in this :
<h3 class="sign-in-header">Your phone number is <?php echo $phone;?> </h3>
Steps I've taken:
Any ideas guys and gals?!
Thanks!!
Upvotes: 0
Views: 127
Reputation: 370
your problem is here this
value=<?php echo $phone;?>
should be
value="<?php echo $phone;?>"
you forgot the quotes
Upvotes: 4