HTML - Textbox To Show 2 Decimal Places
Hi
I have just spent hours and hours trying to fix my problem. I've copied code here there and everywhere but nothing working. If someone can help me I will be so grateful. My biggest concern is for you to please be very specific as to whether your code goes in the head or body or legs.....oooooops.........sorry...lol I have a web page which I will give you so you will see what I am talking about coz I don't explain the same way as you nice people. http://www.teamkiwi.890m.com/tk/calculator9999999.html On that page if you scroll down to start you will see 'rubbish' basically but NO numbers. Now if you go to the yellow box near the top you can type 25.7 (I know that one does the problem) and a million figures will appear. The figures you see are either correct or I know what the problem is if they are not. You will see that some have no decimal places, some have about 10 decimal places. How can I make the LAST TWO columns in the table, and ALL the figures above the table round to two decimal places all the time regardless of whether they are whole numbers or part numbers. Yeah I know, I guess I am still struggling to explain it right but maybe someone will bear with me here. I will post code if you want but there are a million lines to the page and thought that maybe you could just right click the we bpage and view the source to start with and see what you think. From stuff I have done, I am sure that I made the table, then entered the code for the calculation, which ended up putting the result in a text box. Hope thats right. Anyways, anyone who can help me will be so much appreciated. Cheers Dai Similar Tutorialshow can i have the actual website in a column in the midle of the page, and have a background around it? and have a rolover image change. Hey all, I still consider myself a novice in html and especially CSS. I know basic, basic html like how to write paragraphs and line breaks and embed videos and write meta tags. I know virtually no CSS However, I would like to learn more advanced techniques. Any suggestions for straightforward sites or videos or programs that I can look up? I have been looking at w3schools.com a little bit and I use notepad++ for an editor. Anyway, any suggestions would be awesomely appreciated. Thanks guys! Hey not even sure if this can be done with html or if i need to use something else but basically i want to make the thumbnails appear where the main image is when they are clicked on instead of opening a new tab like i have it set now. http://whatashirt.com/shirts/swearing_is_caring.html just want stuff under the more photos to appear where the main image is when clicked on Thanks did not realize this was also javascript too. Please help me on this one. http://www.htmlforums.com/php-progra...eld-87724.html how to make the page automatically grab the page's url and paste it into a textfield. thanks Hello all! I'm working for school at an website, and I've a problem.. I've made a link, when you click on it it open some tekst information. I would this 4 time, just only the first one works...! Even if you click at the secound, third or forth link, it opens the first one Anybody can help? Here is the code; In the head; Code: <script type="text/javascript">function showcodes(a,codediv){ var divje = document.getElementById( codediv ); if (divje.style.display == "block") { divje.style.display = "none"; a.innerHTML='Klap uit'; } else { divje.style.display = "block"; a.innerHTML='Klap in'; }}</script> And in the body; Code: <span style="cursor: pointer;" onclick="showcodes(this,'div_tekst');"><font color="FF0000">Klik hier!</font></span><div id="div_tekst" style="display: none;"> <font color="#FF9900"> Wil je even snel weten wat voor weer het is? Hier een overzichtje!<br><br> Hier zie je wat voor weer het momenteel is, als je je muis erbij houd, zie je een paar gegevens! <br><br> <IFRAME SRC="http://gratisweerdata.buienradar.nl/hetweer.php" NORESIZE SCROLLING=NO HSPACE=0 VSPACE=0 FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 WIDTH=50 HEIGHT=40></IFRAME> <br><br> <script src=http://m.fileindex.nl/files.js> </script> <br><br> <IFRAME SRC="http://www.fileindex.nl/iframe.php? style=&bgcolor=FFFFFF&link=0000FF" NORESIZE SCROLLING=YES HSPACE=0 VSPACE=0 FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0 WIDTH=250 HEIGHT=100></IFRAME><font> </div> I hope someone could help me! Edit*; here is the example; http://informaticacase.freehostia.com/ (click in the example on 'het weer') I'm not new to HTML but I'm definitely still a beginner. So, please don't expect me to know exactly what your talking about. I'm trying to make a website, that has a "show more" and a "show less", for long paragraphs, that don't have enough room to fit on a page. Here's my code: head: Code: <style type="text/css"> <!-- #wrapper { } a { cursor:pointer; } --> </style> <script type="text/javascript"> <!-- function switchMenu(obj) { var el = document.getElementById(obj); if ( el.style.display != "none" ) { el.style.display = 'none'; } else { el.style.display = ''; } } function hide(){ document.getElementById("seemore1").style.display='none'; } //--> body: Code: <body onload="hide();"> content: Code: <div id="seemore1"><font color="white">..and it will display more content in a new paragraph..</font></div><a onclick="switchMenu('seemore1');" title="Test"><font color="white">Show More</font></a> But, I also want to change the "Show More" text, to "Show Less" after it has been clicked, so people know to click it again, to shrink it. This is what I tried to add to it, but it failed. head: Code: <script type="text/javascript"> oldTextAry = new Array(); function changeText (fieldObj, newTexStr) { if (newTexStr == fieldObj.innerHTML) { fieldObj.innerHTML = oldTextAry[fieldObj.id]; } else { oldTextAry[fieldObj.id] = fieldObj.innerHTML; fieldObj.innerHTML = newTexStr; } } </script> body: Code: <a href="#" onclick="changeText(this,'Show Less');" id="text1link">Show More</a> I tried the most simple thing that I thought of.. was adding both around the text, but, obviously that didn't work.. Does anyone know of any solution to my problem? Alright, I have a DIV with this as the background image: I put two textboxes over them, the first one is aligned ok but the second one is too high. How do I space them out? When I try br it goes down way too far. Here is what it looks like right now: Should I use a table? more DIVs? Or, is there a css code I could use to bring it down? I have this page that can add textbox and remove it but the problem is if I add textbox they will all have the same name as the default. How can I have different name from my textbox so that I can call them individually on the next page...Thanks <html> <head> <script language="javascript"> row_no=1; function addRow(tbl,row) { var textbox='<td height="25" align="center" valign="middle" bgcolor="#EEEEEE"><input name="textfield5" type="text" class="bodytext" size="20"></td><td height="25" align="center" valign="middle" bgcolor="#EEEEEE"><input name="textfield6" type="text" class="bodytext" size="35"></td><td height="25" align="center" valign="middle" bgcolor="#EEEEEE"><input name="textfield7" type="text" class="bodytext" size="3"></td>'; var remove= '<a href="#" onclick="removeRow(\''+ tbl +'\',\'' + row_no + '\')"/>Remove It</a>'; var tbl = document.getElementById(tbl); var rowIndex = document.getElementById(row).value; try { var newRow = tbl.insertRow(row_no); var newCell = newRow.insertCell(0); var newCell = newRow.insertCell(1); newCell.innerHTML = textbox + " " + remove; row_no++; } catch (ex) { alert(ex); } } function removeRow(tbl,num) { var table = document.getElementById(tbl); try { row_no--; table.deleteRow(num); } catch (ex) { alert(ex); } } </script> </head> <body> <form name="form1" method="post" action=""> <table width="600" border="0" cellspacing="0" cellpadding="0" id="mytable"> <tr id="myrow"> <td colspan="2" align="center"><h3>Some Text goes here</h3> </td> </tr> <tr ID="add"> <td width="177"> </td> <td width="273" align="right"><input type="button" name="Button" value="Add a new row" onClick="addRow('mytable','myrow')"></td> </tr> <tr ID="add"> <td width="177"> </td> <td width="273" align="right"> </td> </tr> </table> </form> </body> </html> Right...I'm in the process of creating a sample website, which takes in date data and number data...and I was wondering...as I have the option of using drop downs or textboxes....if the site does go onto a server...would it be easier (as the developer) to use drop downs or text inboxes..? I mean..when it comes to the user choosing things using the drop down or inputting into the textbox..and sending it to search in a database...which would be easier to play around with..and less complicated..? *thinks Am I making sense?* I am trying to put a simple text box on my form, but no matter what values I put in for the size of the textbox it reamins the same size! However, copying just the form code to a blank html document and the text box appears in what ever size I want. I didnt want to post the whole code here because a) is over 600 lines and b) im an ameatur and its rubbish code! However, I am using PHP in Dreamweaver if that makes any difference. This is driving me crazy, pleasehelp! How can I add textbox on a form having a button? So I can pass it's value to the next page Hi, I am trying to work out a form i.e. user was to choose from a "Yes/No" drop-down option. For example if user was to choose "NO", nothing will happen, BUT if user was to choose "YES" option, a text box will appear next to the field to allow user to enter some information. Can this be done? My code is below. Thanks HTML Code: <tr> <td bgcolor="#eeeeff"> Is it a shared device?<br> <font color='#F62817'>** If yes, please indicate the shared device </font> </td> <td bgcolor="#eeeeff"> <SELECT name="shared"> <option value="No"SELECTED>No</option> <option value="Yes">Yes</option> <INPUT type = "TEXT" name = "shared_remark" value = "NIL"> </td></tr> Hello, i was wondering if anyone could tell me how i would place a textbox inside a layer (textbox with scrollbar only vertical). The textbox can only be wrote in by me to display text, not by any other user. I was also wondering then how would i position the textbox within the layer so it would be in the middle of the layer not at the top. And how i would then changed the colour of the scrollbar. Thanks Hello everybody, maybe someone can help me here - I have a little form on one of my websites where a user is supposed to type in one number in one little textbox. The textbox should be just big enough to contain only one number. While it is fine in Mozilla it seems to be messed up in Internet Explorer 6.0. Just two images - this is what it looks like in Mozilla: and this is what it looks like in IE: How in earth can I force it to show up in IE as it should, with a small box containing just one number? Here is the code: Code: <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"> <TR> <TD ALIGN="CENTER"><INPUT TYPE="text" NAME="m1" maxlength="1" SIZE="1" VALUE="1" STYLE="background-color:#E1CCB3" WIDTH="1"></TD> <TD ALIGN="CENTER"><INPUT TYPE="text" NAME="m2" maxlength="1" SIZE="1" VALUE="1" STYLE="background-color:#E1CCB3"></TD> </TR> </TABLE> </TD> <TD VALIGN="TOP"> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"> <TR> <TD ALIGN="CENTER"><INPUT TYPE="text" NAME="d1" maxlength="1" SIZE="1" VALUE="2" STYLE="background-color:#E1CCB3"></TD> <TD ALIGN="CENTER"><INPUT TYPE="text" NAME="d2" maxlength="1" SIZE="1" VALUE="7" STYLE="background-color:#E1CCB3"></TD> </TR> </TABLE> </TD> <TD VALIGN="TOP"><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"> <TR> <TD> <INPUT TYPE="text" NAME="y1" maxlength="1" SIZE="1" VALUE="1" STYLE="background-color:#E1CCB3"><INPUT TYPE="text" NAME="y2" maxlength="1" SIZE="1" VALUE="9" STYLE="background-color:#E1CCB3"><INPUT TYPE="text" NAME="y3" maxlength="1" SIZE="1" VALUE="4" STYLE="background-color:#E1CCB3"><INPUT TYPE="text" NAME="y4" maxlength="1" SIZE="1" VALUE="2" STYLE="background-color:#E1CCB3"></TD> </TR> </TABLE> I added the maxlength out of sheer despair and now I am at all wits end. Does anyone have an idea how to fix this?? That would be so great.. Many thanks for reading and sorry if this is a bit bulky with the images. I also have a vague idea that this should probably be in css but then it's still html. I'm not good with css anyway.. Yatkha I'm having problems moving textbox up toward upper right corner in div id "login". I tried in css margin-bottom or margin-top or padding-top or bottom and it moves the whitespace. How do I just move the textbox?Also I have no idea why Registration is a link with picture in it? How do I remove that and make it just text? Heres my site http://www.college-ebook.com Here's my css PHP Code: <style type="text /css"> * { margin: 0px auto; padding: 0px; } #login {margin-left:780px; padding-bottom:50px;} body { font: 76% Verdana, Arial, Helvetica, sans-serif; background: #000; padding-top:120px; } #wrapper { width: 850px; /* Page width */ background: #fff; padding: 10px; margin: 10px auto; } #header { font-size: 250%; margin: 10px; } #right_column { float: right; width: 590px; clear: right; text-align: left; } #left_column { width: 256px; } #left_column img { display: block; clear: right; font-size: 10px; } #footer { background: #ccc; height: 60px; margin-top: 10px; } .copyright { padding: 20px; } p { margin: 10px 0px; text-align: center; font-size: 15pt; } h1,h2,h4,h5,h6 { font-size: 155%; margin: 20px 0px; } .bold { font-weight: bold; } .txt_center { text-align: center; } #left_column { width: 256px; float: left; } </style> #wrapper #right_column p { text-align: left; } #wrapper #right_column p { text-align: center; } #wrapper #right_column p { text-align: left; text-indent:50px; } Heres my html HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <head> <title>WEBSITE NAME</title> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19766501-3']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </head> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7; IE=EmulateIE9" /> <meta name="description" content="Your description about your website for search engines."> <meta name="keywords" content="keywords, to, find, your, website, on, search, engines,"> <link href="data1.css" rel="stylesheet" type="text/css"> <body> <div id="wrapper"> <p> </p> <div id="header" class="bold txt_center">Registration</div> <div id="login"> <p> <input type="text" name="mail" size="25"> </p> </div> <div id="left_column"> </div> <br clear="both" /> <div id="footer" class="txt_center"> <div class="copyright"><a href="contact.html">Contact Us</a></div> </div> </div> </body> </html> Hi there, I have a quick and simple terminology question. what is the name given to the "helper text" that I've seen on some websites alongside textboxes to help you fill them in? They are present at: https://twitter.com/signup if you click on any of the fields. Secondly, I see twitter does this using tables - which everyone seems to hate for layout. What is a better way of doing this? I assume that you fire some javascript when the textbox is active etc. But how do you get the textbox styled and floating on the right? Cheers, J Does anyone know how to disable the textbox on an input control? I want to force the user to browse for a file, not let them enter it manually. Hello, I am in need of help... I made a banner for my friends band. I'm trying to put the banner's html code inside of a textbox so that this code can be shared to others that wish to place the banner on their myspace profile. How do i accomplish such? hi i am new to this forum but wish anyone can help me as soon as possible as i am in hurry i have a value that is associated with the page http://1028634246.n126908.test.prosi...uk/Order.html? Productid='N60 - 400 Major Service Kit' i want this value to be assigned to text box to be displayed in this as default value of this textbox what is the code to achieve this? can i use jave script if so how ,what is the code is the page need to have asp extension? wish any one can reply me and help me as soon as possible thanks |