john1ouk Posted October 22, 2007 Share Posted October 22, 2007 Hi, First I'd like to say what a great forum. The posts have really helped me with some troublesome scripts. I've recently purchased this billing script https://www.ajaxinvoice.com which has some really good simple functionality but unfortunately the support is poor which is why I'm posting on here. I've been changing the script to meet my business needs and got stuck on what is probably a very simple thing to a php wizard but for the life of me i can't work out where I'm going wrong. What I'm trying to do is put HTML into the product description. If you have a look at this page in their demo you'll see what I mean. http://www.ajaxinvoice.com/demo/ login to the demo with the username 'admin' and the password 'admin' and then visit this link http://www.ajaxinvoice.com/demo/scripts/est/estimate_item_addedit.php?ql=f&txtEstimateId=23 to view the estimate page I'm talking about. I've changed the MySQL database description field to TEXT and removed the Length on the structure of the database so I'm able to add HTML descriptions instead of just text descriptions but the problem I've encountered is when I try and add a product to an estimate. If you look on the demo above what happens is you click on "select" to the right of the product which then puts the information into temporary form at the bottom. This gives you the option to change the product before you add it to the estimate. This is where I have the problem. What I need to do is change the textfield "Description" to a textarea so the HTML code can be copied into it before you save and it's added as a product to the estimate. I've been able to change the textfield to a textarea buy changing the code as show below but now the description isn't entered into the textarea at all. If I change the start of the code back from <textarea to <input I can see the html code in it again but I loose the text area and only get one line of HTML code. OLD CODE: <input type=\"text\" name=\"txt".$lineItemSectionObj[$i]->FieldName."\" value=\"".$value."\" size=70 class=inputText MaxLength=255 > NEW CODE: <textarea rows=\"5\" cols=\"50\" type=\"text\" name=\"txt".$lineItemSectionObj[$i]->FieldName."\" value=\"".$value."\" class=inputText ></textarea> The script is php 5 and below is the full code of the form I'm trying to change. ------------------------- <?php switch($fld) { case "Name" : echo "<input type=\"text\" name=\"txt".$lineItemSectionObj[$i]->FieldName."\" value=\"".$value."\" size=50 MaxLength=64 class=inputText>"; break; case "Description" : echo "<input type=\"text\" name=\"txt".$lineItemSectionObj[$i]->FieldName."\" value=\"".$value."\" size=70 class=inputText MaxLength=255 >"; break; case "Rate" : if (empty($value)) $value = 0; echo "<input type=\"text\" name=\"txt".$lineItemSectionObj[$i]->FieldName."\" value=\"".$value."\" size=6 onChange=\"addAmount(this)\" class=inputText onKeyUp='isRule(this,g_ruleNumber)'>"; $rate = $value; break; case "Quantity" : if (empty($value)) $value = 0; echo "<input type=\"text\" name=\"txt".$lineItemSectionObj[$i]->FieldName."\" value=\"".$value."\" size=4 onChange=\"addAmount(this)\" class=inputText onKeyUp='isRule(this,g_ruleNumber)'>"; $qnt = $value; break; case "IsTaxable" : $stat = ($value == '1' ? "checked" : ""); echo "<input type=\"checkbox\" name=\"txt".$lineItemSectionObj[$i]->FieldName."\" value=1 ".$stat." size=30 class=checkBox >"; break; case "QuantityUnit" : $pageObj->ShowSelectFromArray("txtQuantityUnit",$UnitValueArray,true,$value,""); break; } ?> ------------------------- Any help with this matter would be really appreciated as I'm really stuck on this one. Thanks John Quote Link to comment https://forums.phpfreaks.com/topic/74324-billing-script-form-help/ 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.