oceans Posted May 17, 2007 Share Posted May 17, 2007 Please run, this it is interesting, a block of 10 spaces are always added each time I press submit, have taken all precautions, but could not see catch. <?php ob_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title></title> </head> <body> <?PHP $NumberOfTxtBoxes=1; $NumberOfTxtBoxesMustBeFilled=1; $MaxLengthTxtBox=200; //Transfer Data from Screen to Memory if (isset($_POST['Submit'])) { for ($i=1; $i<=$NumberOfTxtBoxes; $i++) { $InputFromScreen[$i]=strip_tags(rtrim(ltrim(strtoupper($_POST["Txt".$i])))); } } else { for ($i=1; $i<=$NumberOfTxtBoxes; $i++) { $InputFromScreen[$i]=""; } } ?> <form id="form1" name="form1" method="post" action="exampltextbox.php"> <table width="300" border="0" cellpadding="0" cellspacing="0"> <tr> <td><span class="FieldValue"> <textarea name="Txt1" cols="70" rows="5" class="FieldValue" id="Txt1"><?PHP echo $InputFromScreen[1]; ?> </textarea> <input onclick="return count()" name="Submit" type="submit" class="FeildButton" id="Submit" value="Submit" /> </span></td> </tr> <tr> <td><span class="PHPRunTime"> <?PHP //Checking for Unfilled Fields $TxtBoxesNotFullyFilled=0; for ($i=1; $i<=$NumberOfTxtBoxesMustBeFilled; $i++) { if ($InputFromScreen[$i]=="") { $TxtBoxesNotFullyFilled=1; break; } } if ($TxtBoxesNotFullyFilled==1) { echo "All RED Fields Should be Filled!"; } else { //Check Max Length Of Description Property if (strlen($InputFromScreen[1])<=$MaxLengthTxtBox) { } else { echo "Your Description is " . strlen($InputFromScreen[1]) . " Characters long, Maximum Allowed is " . $MaxLengthTxtBox . "!"; } } ?> </span></td> </tr> </table> </form> </body> </html> Quote Link to comment Share on other sites More sharing options...
jitesh Posted May 17, 2007 Share Posted May 17, 2007 insted of <textarea name="Txt1" cols="70" rows="5" class="FieldValue" id="Txt1"><?PHP echo $InputFromScreen[1]; ?> </textarea> Keep <textarea name="Txt1" cols="70" rows="5" class="FieldValue" id="Txt1"><?PHP echo $InputFromScreen[1]; ?></textarea> Quote Link to comment Share on other sites More sharing options...
oceans Posted May 17, 2007 Author Share Posted May 17, 2007 I am sorry I could not get you, your proposal and the original is exactly the same. Quote Link to comment Share on other sites More sharing options...
jitesh Posted May 17, 2007 Share Posted May 17, 2007 You have <textarea name="Txt1" cols="70" rows="5" class="FieldValue" id="Txt1"><?PHP echo $InputFromScreen[1]; ?>Some Space</textarea> My advise to remove Some Space Quote Link to comment Share on other sites More sharing options...
radar Posted May 17, 2007 Share Posted May 17, 2007 Thats where your spaces are coming from... move the </textarea> to right after the ?> and try it -- it'll work.... Quote Link to comment Share on other sites More sharing options...
oceans Posted May 17, 2007 Author Share Posted May 17, 2007 Dear People, Oh Boy!!!!! I was using all those function to remove it. Thank you very much 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.