Jump to content

Text after space character cut off in input text field when editing form back


Lisa23

Recommended Posts

Hi i have this edit form that allows user to mofy data but the problems on the text box is that it deletes the rest of the data after the space from the first word i tried to increase the size of the varChars on mysql but did no work why it happens how can i stop from happening??

 

this the form input

<input type="text" name="name" id="name"  class='text_box' value="<?php echo $_GET['name'];?>"/>

i suspect the problem is that the content is not properly escaped for HTML output in a form field. maybe try making the string html safe:

 

<input type="text" name="name" id="name"  class='text_box' value="<?php echo htmlspecialchars($_GET['name']);?>" />

 

If the data is displayed after a form GET or POST, you may need to stripslashes() before you htmlspecialchars().

 

another possibility off the top of my head is the style (CSS) setting for the field. perhaps it is set to a short max size? hope this helps

Hi i never really done any of the stripslashes or htmlspecialchars(). i tried to reserach about but none seem to be wrking with my script if i set a lengh of text in the input will that affect the txt in it i mean i set size 40 and i only add 2 words on the text like joana travolt and still cut off travold can u can you or sum1 give me an example??

I tried like this but gt error

<input type="text" name="name" size="40" class='text_box' value<?php echo stripslashes(htmlspecialchars($_GET('name'))) ?>>

 

Fatal error: Function name must be a string in C:\xampp\htdocs\rocksamples\modifydriversform.php on line 89

like this

value=<?php print (stripslashes(htmlspecialchars($row['name'])))?

still no sucess that strange cz i on the edit form i can type as much as i want then when submit it sends every word fine but then when i edit back alwasy cut the rest of the word y

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.