HTML - Textbox And Select Box Width Equal??
how to give equal width/size for a input type textbox or select box for all the browsers (ex: Ie7, FF2 and 3 etc..)
Code: <input type="text" size="20" value="" /> Now this size varies in different browsers. So I used Code: <input type="text" value="" style="width:150px;" /> This worked properly. But when I do this styling for select box its not happening. Code: <select name="123" style="width:150px;"><option>eeee</option><option>rrrr</option></select> The point is I want the text box and the select box width to be same when I am using them largely in forms.. Anyone knows the solution?? Similar TutorialsHey all, http://www.lindesigns.us/rma/rmaonline.php If you go to that site on Firefox, the "Return Code #" expands. But if you use IE, you'll see that it doesn't. I could add a fix in there for the fields if they were static, but if you see my javascript, they are dynamically loading fields. This "class":"wide" is not working: Code: invoiceInput.appendChild(createElement("input", {"type":"text", "name":"invoice[]", "size":"8", "class":"wide;"})); I am using a script I found on a jQuery board (http://jsbin.com/acado/6), and it works for them, but not for me because my syntax is probably wrong. And they also are just using 1 field and not near-unlimited dynamically loading fields like I am. How would I add in a fix to have the browser 'only' use the expansion if the user is using IE6 or IE7? I searched on the boards but couldn't find the solution to this problem. Thanks in advance! I was wondering how I can make 3 equal size div columns inside of a iframe? Because my site www.PrimeNewsCenter.com and I have 3 iframes right now inside the main iframe on the front page and although it looks good in IE it looks really bad in all other browsers and divs dont look like that. Thanks! im creatinh a box containing a text. The box must be wide enough to fill a text. menu.style.width = tekst.length - this functioin gives the number of letters in text. So if the text is "hello" then the width is 5 pixels. But i need the widith of pixels needed to fit the text in a box. How can i do that? Hi, Is there away to force my website to fit an Iphone screen when viewed on the iphone. At the moment the width doesn't full span the Iphones screen so it looks bad. http://pjm.co.uk.uksite4.yourwebserv...splay&PageID=5 Thanks alot Joe 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 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> 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! 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 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> How can I add textbox on a form having a button? So I can pass it's value to the next page 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? 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 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 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? 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. 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 everybody, I have a textbox and I want the text of that textbox display in a div. I want the text in the div to be updated as the user writes in the textbox. I hope this makes sense, I have searched everywhere and I have no idea on how to get it working, please help me out here. I also want this to work when the textbox is set to disabled. Thanks Hi all, how do i go about making my html form textbox borderless like the one in this picture? I want to make my form a bit better looking, so any links to customising them would be good. |