richardbeaumont Posted November 28, 2007 Share Posted November 28, 2007 I have a form where the value of a hidden input area is a variable. This works fine when the value of the variable is a single word. However if it is two words - only the first word actually goes into the form. why and how can I fix. I am a newbie. Richard Quote Link to comment Share on other sites More sharing options...
helraizer Posted November 28, 2007 Share Posted November 28, 2007 Any more clues? Or do we guess? Please post the code that you have already. Sam Quote Link to comment Share on other sites More sharing options...
richardbeaumont Posted November 28, 2007 Author Share Posted November 28, 2007 here is my code. the first echo is just to prove that the variable appears fine when it is not in the form, the second is where the variable is the value for the form field. <!-- echo $rowcomp; echo "<form enctype='multipart/form-data' action='reviewform.php' method='post' target='_blank'><input type='text' value="; echo $rowcomp; echo " name='company'><p id='alignright'>Add you own review: <input type='submit' value='Click Here'/> </form></p>"; --!> When the variable has a vlaue 'Company Name' I get this: Company Name [Company ] (square brackets for the form field) In other words if there is a space in the value of the variable, only the first part appears - and when I submit the form - the post comes out with just the first half. Any help appreciated. Richard Quote Link to comment Share on other sites More sharing options...
Wolphie Posted November 28, 2007 Share Posted November 28, 2007 Try echo $rowcomp; echo "<form enctype='multipart/form-data' action='reviewform.php' method='post' target='_blank'> <input type='text' value='" . $rowcomp . "' name='company'> <p id='alignright'>Add you own review: <input type='submit' value='Click Here'/> </form></p>"; Quote Link to comment Share on other sites More sharing options...
richardbeaumont Posted November 28, 2007 Author Share Posted November 28, 2007 Thank you! Its always the little things - the single quote around the value that was missing. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.