eddie_twoFingers Posted June 18, 2008 Share Posted June 18, 2008 Having trouble displaying data in an input field in Internet Explorer, Opera, and Apple Safari browsers but works fine in Firefox and Netscape. The field is located in the websites shopping cart and gets its data via $_GET method when an item is added to the cart. Any help as to why it wont display in IE at least would be greatly appreciated. <input name="grand" type="text" id="grand" value=" <?php if (($_GET['loc'] == "lcl") || ($ship_ref == 'lcl')) { echo '$'. ($grandTotal = number_format($totalCost, 2, ".", ",")); } elseif (($_GET['loc'] == "nat") || ($ship_ref == 'nat')) { echo '$'. ($grandTotal = number_format($totalCost+4.50, 2, ".", ",")); } elseif (($_GET['loc'] == "rul") || ($ship_ref == 'rul')) { echo '$'. ($grandTotal = number_format($totalCost+6.50, 2, ".", ",")); } else { echo '$'. number_format($totalCost, 2, ".", ","); } ?>" size="10" class="grandTotal" style="border:0pt none;" readonly /> Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/ Share on other sites More sharing options...
hitman6003 Posted June 18, 2008 Share Posted June 18, 2008 What does the text in the value attribute look like? In other words, what is php putting out? Does it look normal? Is it malformed? Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/#findComment-567711 Share on other sites More sharing options...
eddie_twoFingers Posted June 18, 2008 Author Share Posted June 18, 2008 In FF and Netscape it is normal and displays as it should. In IE and the others, nothing is displayed, no text at all. Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/#findComment-567715 Share on other sites More sharing options...
hitman6003 Posted June 18, 2008 Share Posted June 18, 2008 if you look at the html source (output to the browser), what does it look like... Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/#findComment-567717 Share on other sites More sharing options...
eddie_twoFingers Posted June 18, 2008 Author Share Posted June 18, 2008 IE shows <input name="grand" type="text" id="grand" value="$30.90" size="10" class="grandTotal" style="border:0pt none;" readonly /> so its there, I took out class="grandTotal" style="border:0pt none;" readonly to see if that was it, but no, just displays an empty box in IE FF shows <input name="grand" type="text" id="grand" value="$30.90" size="10" class="grandTotal" style="border:0pt none;" readonly /> and displays the value as expected. Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/#findComment-567724 Share on other sites More sharing options...
l0ve2hat3 Posted June 18, 2008 Share Posted June 18, 2008 thats not possible, if the only html source is: <input name="grand" type="text" id="grand" value="$30.90" size="10" /> it will display... there must be something else going on. please post all of the html source Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/#findComment-567729 Share on other sites More sharing options...
bluejay002 Posted June 18, 2008 Share Posted June 18, 2008 just like what love2hat3 said, its fairly impossible not to display with only such code. please post the html source so that the people can help. Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/#findComment-567737 Share on other sites More sharing options...
eddie_twoFingers Posted June 18, 2008 Author Share Posted June 18, 2008 Damn, just found the problem, it was because I had started the php on a new line.... doesnt work: <input name="grand" type="text" id="grand" [b]value=" <?php[/b] if (($_GET['loc'] == "lcl") || ($ship_ref == 'lcl')) { does work: <input name="grand" type="text" id="grand" [b]value="<?php[/b] if (($_GET['loc'] == "lcl") || ($ship_ref == 'lcl')) { someone slap me Thanks for the help, sorry to have troubled you. Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/#findComment-567742 Share on other sites More sharing options...
bluejay002 Posted June 18, 2008 Share Posted June 18, 2008 nah... no need, that was a nice find for you. welcome to the forums! Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/#findComment-567745 Share on other sites More sharing options...
eddie_twoFingers Posted June 18, 2008 Author Share Posted June 18, 2008 Thanks Quote Link to comment https://forums.phpfreaks.com/topic/110661-solved-displaying-data-from-_get-in-input-field/#findComment-567747 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.