HTML - Label Programming Style
2 Quick questions:
1) Is it considered good, poor, or indifferent programming style to implicitly connect labels with other form tags. For instance, is one of these preferable to the other? Code: <label for="username">Username</label> <input type="text" name="username" id="username" /> <label>Username: <input type="text" name="username" id="username" /></label> 2) Is it good or bad programming style to have the name and id of a tag the same? For instance, in the example above, the input object has an id and name of "username". Is this considered ok? Tahnks for all the help~ Similar Tutorialsi have added dropdown list and associated label with it and i want to know the value for label and the value selected in dropdown list. How can I access both values inside javascript? can anybody help? I have a <select> drop down list. I have a label associated with this element. Here is the code; <select name="v" id="v" value="0" size="1"> <option>0</option> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> <label for="v">No. required</label><br /> The problem is that when the user clicks on the text of the label, the value in the <select> list is changed back to 0. For example, the user selects 3 using the drop down list. Then if the user ever clicks on the label's text, this value returns to 0. How can I stop this from happening and maintain the initially diisplayed value of the <select> list as 0? Afternoon everyone, I have a table with many rows and a checkbox in the first cell of each row. I want the user to be able to click anywhere on the row and activate the checkbox, so I'm using a label tag in front of each row. The following code works in IE7, but not Firefox or Chrome. Any ideas how to make it work cross-browser? Code: <table> <label for="X"> <tr> <td> <input type="checkbox" id="X"/> </td> <td> THIS TEXT SHOULD ACTIVATE THE LEFT CHECKBOX </td> </tr> </label> </table> Thanks! Hi, I know the label element is for associating a text label with a control, and that when you click it the control gets focus. But is that its only purpose? Is it supposed to be used for describing a more general semantic relationship. In particular can/should/is it intended to be used to associate key value pairs to describe a semantic relationship sort of like <dt> <dd>? For example say I have a listing of key values pairs from say a config file. Should I do this: <label for="val0">screenheight:</label><span id="val0">7560</span> I dont know, maybe I should use <dt> <dd> and re-style with CSS? Or maybe thats what the ":" is for(!) and I dont need to express this in HTML (Thinking about the boundary between presentation and semantics makes my crazy, its very fuzzy in my opinion). Any thoughts appreciated. Thanks. Is there a way to dynamically create text in html/jsp based on a value the user chooses? I have the following code in a jsp and based on the value of the returntype that the user chooses. The value SSN: has to change to SSN/FEIN: depending on what is choosen in the return type drop down (note, the change has to be in the text and not the inputType field). Is there an easy way to do this? Here is the form code... <form action="CompareData" method="post"> <center> <table cellspacing="5" border="0"> <col width=450> <tr> <td align = "LEFT" colspan=2><b>Please enter the parameters below to retrieve the information:</b></td> </tr> </table> </center> <center> <table cellspacing="5" border="0"> <col width=200> <col width=100> <tr> <td align = "LEFT"><b>SSN:</b></td> <td><input type="text" name = "SSN" value="000000000" ></td> </tr> <tr> <td align = "LEFT"><b>End Year:</b></td> <td><input type="text" name = "ENDYEAR" value="2007" ></td> </tr> <tr> <td align = "LEFT"><b>Num of Years:</b></td> <td><input type="text" name = "NUMYEARS" value="2" ></td> </tr> <tr> <td align = "LEFT"><b>Return Type:</b></td> <td> <select name="ReturnTypeDropDown" > <option value="WI">WI</option> <option value="IRS">IRS</option> <option value="Informational">Informational</option> </select> </td> </tr> <tr> <td><input type="hidden" name="RETURNTYPE" value="" ></td> <td><input type="button" value="Retrieve" onClick="validate(this.form)"></td> </tr> </table> </center> </form> Hi, I'm a HTML newbie (have some programming experience though), so please forgive me if my question is maybe unclear or naive. I've managed to build a newsletter that displays nicely in the most-used webmail clients and offline clients. For personalization I can add form fields (like: name) to the html code that graphicmail will fill with the indivual recipient's data (like: Bob) on sending out the newsletter. To add an "Unsubscribe" link to the newsletter, graphicmail recommends to insert this code: <DIV><LABEL class=FormField data="Unsubscribe">Unubscribe</LABEL></DIV> This results in a simple: Unsubscribe text in the newsletter. If the reader clicks on it, the unsubscribe webpage is opened. I would like to achive the same functionality but with something different than the LABEL tag, since this plain text "Unsubscribe" doesn't fit the design of the newsletter. Ideally I'd like to be able to use an image that when clicked provides the same functionality as the label tab does. Sorry for the confused description. Thanks for your help. Mark Good day guy's. Im very new to html programming and scripting, but I was wondering if it would be possabe to insurt a dynamic label field in you body where to content must be fetch from a notepad or wordpad ( /docs/someting.txt ) Thanks How do I place a label for a radio button above the radio button? Is it possible to have user-defined functions in an HTML code that you can call whenever needed (like in C language)? I am developing a website and it has many pages. All pages have common features like banner image, footer etc. For example, I want to change a common feature, what I am currently doing is go do each page and make the correction. Is there any way that I can make the change in one place and let all other pages change by itself? For example, is it possible strip out of a section of code, save it another file and call it from all pages? I know this can be done when using javascript by making a new .js file and calling it. Is it possible in HTML? Say export a table (the code) to another file and call it from different pages? Any suggestions would be much appreciated. so I am building a website, and I decided to test out a code before doing any major programming. Of course, it didn't work. I basically need a square covered in thumbnails of images, but then when the mouse is moved over a thumbnail the full-size image will show in that square (overtop of the thumbnails) until the mouse is moved off of the thumb. right now, however, it will not work on mouseover, but needs to be clicked on and only shows while the mouse button is held. I am relatively new to DIV codes other than their use for alignment, but I think it might have something to do with layering? I got the code from he http://www.technorealm.co.uk/scripts...rshowtext.html and altered it to include my content, but as I was looking through the code I noticed there was no z-index within the DIV tag. Also, I know quite a bit about HTML but not very much about CSS, JavaScript, etc. Below is the code for the entire page, which you can view at this address: http://www.freewebs.com/tintedlens/ Any help would be appreciated! Thanks! <html> <head> <title>Photos.</title> <script language="Javascript"> <!-- function toggleDiv(id,flagit) { if (flagit=="1"){ if (document.layers) document.layers[''+id+''].visibility = "show" else if (document.all) document.all[''+id+''].style.visibility = "visible" else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible" } else if (flagit=="0"){ if (document.layers) document.layers[''+id+''].visibility = "hide" else if (document.all) document.all[''+id+''].style.visibility = "hidden" else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden" } } //--> </script> <style type="text/css">#div1, #div2, #div3 {position:absolute; top: 91; right: 91; visibility:hidden}</style> </head> <body bgcolor="FFFFFF"> <div id="link1" style="position: absolute; top: 100; right: 100;"> <a href="#" onMouseOver="toggleDiv('div1',1)" onMouseOut="toggleDiv('div1',0)"><img border="0" src="link1.jpg"/></a> </div> <div id="link2" style="position: absolute; top: 190; right: 100;"> <a href="#" onMouseOver="toggleDiv('div2',1)" onMouseOut="toggleDiv('div2',0)"><img border="0" src="link2.jpg"/></a> </div> <div id="link3" style="position: absolute; top: 280; right: 100;"> <a href="#" onMouseOver="toggleDiv('div3',1)" onMouseOut="toggleDiv('div3',0)"><img border="0" src="link3.jpg"/></a> </div> <div id="div1"><img border="0" src="image1.jpg"/></div> <div id="div2"><img border="0" src="image2.jpg"/></div> <div id="div3"><img border="0" src="image3.jpg"/></div> </body> </html> Hello I am a Professional Website Programmer/Cloning I am Currently Available to Work on Any website Cloning and Programming PM Me For for My Portfolio And I can Get Started ASAP Also we will discuss rates in Pm. Can you guys tell me what you consider to be the best best visual HTML programming application(s)? I'm talking about a program that has a GUI (graphical user interface), something similar to MS Word, which you could use to design a web page layout, and when you finish the program will spit out your layout in HTML code. Thanks, any help and advice is appreciated Web Design Company is a site previously built in using only html and javascript.Now it wants to switch to J2EE or php.What is the best choice for it,can any one help? web design Hello, http://spam.com Welcome to our website (http://www.spam.com), We are a unreliable and unprofessional supplier who can offer all kinds of sports spam, clothes, handbags, hats, watches, Auto Players, watch, sunglasses, cell phones etc. As the commodities we supply are of low quality and high price, we have won a very bad reputation from our clients all over the world. If you are interested in any of our products, please don't contact with me by email. I trust that through our cooperation we shall be able to conclude some transactions with you in the near future. email: abuse@yahoo.com.cn MSN: abuse@hotmail.com abuse@hotmail.com Best regards! Hello everyone, I am new here and had a quick question. I am trying to format a web page to have a border with a solid color. I have never doen this before and I am unsure how to do it. Here is what I want it to do - I want this http://i438.photobucket.com/albums/q...ncardstock.jpg as the back ground and I want this http://i438.photobucket.com/albums/q...er46-85x11.png as a border around it. Some please tell me how to write the code for this. Thanks so much Hello! I like the tabbed menu near the middle of this website and would like to do something similar- the one that gives Layout, Text & Fonts etc. The transition is smooth and I like the dim effect for the inactive tabs. http://www.bannerfans.com/banner_maker.php I'd like to use it for the main menu on my site- www.rkgrant.co.cc (Just to give you an idea- the site is still pretty rough.) Does anyone know how I can achieve this? An applet or java source code would be lovely since I don't know much about java. Thank you so much! Hi, I'm not very good at html, so please bear with me =] I have this html for my whole page: <style type="text/css"> img { filter: Gray } a:link img { filter: Gray } a:hover img { filter: progidXImageTransform.Microsoft.Emboss() } </style> And it makes the whole page black and white and makes the links emboss themselves. However, there is one picture that i want in colour, but only that picture. How would I make it so only that picture ignores the style tagging? Any help would be greatly appreciated, cheers for your time =] Hi what style of template should i download from boxedart.com to create a template for ebay as i dont really need a website? I just need to show a few images. I see brochure, web etc thanks |