Page 1 of 1

Form field & spaces

Posted: Thu Nov 04, 2010 1:07 am
by vfm
Hi,

I'm not sure if this is a php issue or an sql one. I have a field 'color' and when I put in say "Navy blue" and output that into a input field I only get "Navy". Can anyone help explain to me why this is happening and what I need to do to get around it?

Thanks in advance.

vfm.

Re: Form field & spaces

Posted: Thu Nov 04, 2010 3:09 am
by Blackveiled
Try making sure the field value in your database where "Navy blue" is found is "varchar" type. Otherwise, you should explain with more detail. It's probably an SQL problem.

Re: Form field & spaces

Posted: Thu Nov 04, 2010 3:21 am
by vfm
Hi,

It doesn't actually look like it's an SQL problem. When I submit a value and look at the database I see the full string. However, when I use this:

<input type="text" name="colour" id="colour" size="50" value=<?= $row['colour'] ?>>

I see "Navy". Does it have something to do with the way I'm calling it?

Cheers,
vfm.

Re: Form field & spaces

Posted: Thu Nov 04, 2010 3:50 am
by s.dot
Your value attribute needs to be in quotes in the HTML.

Re: Form field & spaces

Posted: Thu Nov 04, 2010 5:19 am
by Blackveiled
s.dot wrote:Your value attribute needs to be in quotes in the HTML.
This.