Display truncation in php echo in a field

the_fitz 11 Oct, 2010
Hi all,

I'm kinda bummed.😢 I have a form that needs to update a couple of tables so I had to design the form and write the code in the onsubmit event after email. The good news is that it saves the data properly into the fields, the bad news is that if the field entry is more than one word, like an address with spaces like "7144 NW 47 th Lane". The PHP echo, in the forms value= string only displays up to the first space. See here Display truncation in php echo in a field image 1

I don't know what to do, I have tried everything I could think of but I'm stumped. here is a code snip.
<div class="form_item">
  <div class="form_element cf_textbox">
    <label class="cf_label" style="width: 150px;">Address 1</label>
    <input class="cf_inputbox" maxlength="150" size="30" title="" id="text_47" name="add_1" type="text" value = <?php echo $add_1; /* ***** this is the problem**** */ ?> >
  
  </div>
  <div class="cfclear"> </div>
</div>


I need to get this resolved so I can forge ahead with my application.

Any help will be appreciated. It MAY be a bug,or it could be something I am missing, PLEASE HELP!

Thanks in advance for your time. let me know if you need into my site.

The_fitz
GreyHead 11 Oct, 2010
Hi the_fitz,

You need quotes "" or '' around the value attribute
 type="text" value="<?php echo $add_1; ?>" >
otherwise the browser sees
 type="text" value = 7144 NW 47 th Lane >
and has no way of parsing the HTML correctly

Bob
the_fitz 11 Oct, 2010
Hi Bob,

What a rookie error, on my part. I know better!!😶 I couldn't see the forest for the trees!! Thanks for cleaning my glasses.

The_fitz
This topic is locked and no more replies can be posted.