html

Single Choice Dropdown

I am building a form to rank series of items. The user will read the item and select in a dropdown the rating from 1 to 20. All 20 items will be displayed at the same time. What is the best way to make sure that the user didn't select the same number for more than one choice? Then I would display an error message, "You've already ranked ...

resize shadowbox with HTML content

I'm using a jquery shadowbox library, wich allows you to show HTML content in a lightbox/shadowbox. (www.shadowbox-js.com) My question is: is there any way to dynamically resize the shadowbox when it's already open (the content becomes bigger). You can set the start dimensions, but it seems pretty hard to change the dimensions later on...

Set values of LI tag in HTML

I have a Ordered list that I need to set the # values for. Something like: <ol> <li ShowValue=34>apple</li> <li ShowValue=45>pear</li> <li ShowValue=55>car</li> </ol> So that they display with the numbers I assign 34.apple 45.pear 55.car Is there a way to tell the LI what number it should show? ...

How would you align the left side of a div to the center of the page?

I have a stack of divs down the center of the page (using margin:auto) now I want to draw a line starting at the center and extending to the right (say 400 pixels). I'm a but stumped, any idea how to make this work nicely? cheers! ...

JavaScript-HTML: Create ComboBox with non-selectable items

I would like to create a ComboBox like you can see in the following image The Combo/Menu/List should allow some items to be bold (Main Categories), and to have "sub-categories" under each main category. The bold items should not be clickeable or selectable (I guess these items should have value="") ? Thanks ...

Google Semantic results question

http://www.google.co.uk/search?q=mark+zuckerberg+crunchbase Guys, check out that search, in particular the first result's url. Crunchbase.com > People, and thus the people links to the /people section of the site. How are they achieving it? I know Google algorithm is intelligent and looks for links and then makes the assumptions itself...

How do you make a good web site design

What resources do you use to make a good and beautiful web site design? Do you use templates? What patterns you use? Are there any web site with good resources and ideas? ...

Asp.net server side Conditional attribute or unchecked attribute?

I have the following aspx code: <% foreach (ModelDefect modelDefect in GetCodes()) {%> <tr> <td><input disabled="disabled" name="<%= modelDefect.Code %>" value="<%= modelDefect.Code %>" type="checkbox" checked="<%=modelDefect.CompletedDate.HasValue? "checked":string.Empty %>" /></td> <td><a href="javascript:submitForm('<%= m...

Getting an excerpt from HTML in PHP

I need to get a short excerpt of news items written in HTML to show on my front page. Obviously I can't use something as simple as substr because it might leave tags unclosed or even leave half a tag. Which is easier: Converting the HTML to decent looking plain text and take a piece of that Taking the beginning from the HTML and closi...

Detecting an URL that redirects to another location

I need to detect when an URL redirects the browser to another location, including javascript redirects. I thought of using an actual web browser engine with javascript support to achieve this, by loading and interpreting the html from the url and setting some sort of "hook" to be notified whenever the browser changes the address. Can an...

IE6 Text goes missing in dl tag

I'm testing a website in Internet Explorer 6 and I am baffled by this issue. I have a data-list on the page, which shows the amount to pay - here it is. <dl> <dt>Amount to pay:</dt> <dd class="note"> <span id="total">£39.99</span> (includes delivery) </dd> </dl> The CSS rule for this is such that it lays out like...

Simple HTML DOM help

How can I extract the value attribute of an input tag? Using SIMPLE HTML DOM let me give you an example: <form action="#" method="post" name="test_form" id="test_form"> Name<input type="text" name="name" value="NaMe"/><br /> Address<input type="text" name="address" value="AdDrEsS"/><br /> <input type="hidden" value="sayantest" /> </fo...

Use of double quotes in a 'input type="text"' value wont work, string stops at double-quote !

How can I make it possible for users to use the '"' (double quote) inside a textfield... Whenever I do use double-quote in the field (the value) then when receiving the variable in my PHP file with: $text=mysql_real_escape_string($_POST['subject']); and then echo it, I get a string which is escaped properly, but the string stops e...

jQuery each function html list, just return object

Hello I have a bit of problem with my function who just should return html code function contentStringHtml(data, name) { return '<div id="gm-event-title">' + '<h2>' + name + '</h2>' + '</div>' + '<div class=\"gm-trafic-index\"><ul>' + $.each(data.DataTime, function(i, item) { r...

Is there a way to parse html with lxml, but manipulate it with minidom?

I have an application where I've been using html5lib to liberally parse html. I use the minidom interface, because I need a real DOM API and ElementTree is not appropriate for what I'm doing. Here's how I do this: parser = html5lib.XHTMLParser(tree=html5lib.treebuilders.getTreeBuilder('dom')) parser.parse(html) However, parsing huge ...

Why should I keep the cellspacing attribute in the markup?

I was looking for some resources about the use of CSS instead of tables and reached this presentation by Douglas Bowman that seems to be a 'classic'. I dug into it and found this sentence about the tables in the slide 6 that is very intriguing: Keep the cellspacing attribute in the markup. It's curious that in Eric Meyer's reset C...

API for word definitions...

hi all, i'm trying to implement a little app which basically only hs a label, textbox and a button and when the user enters a word, i want to connect to some online api to retrieve the word's definition and display it in the label. is this possible? all i keep finding is api's related to other stuff on google/other se's. but i have seen ...

Simple CSS Centering Problem only on IE7, Chrome and FF Fine

I'm having a problem with a centered div only on IE7... on Chrome and Firefox it works properly. Here is the website, it's on Volusion.com so go easy on me it's an old platform :) http://www.ecosandbags.com Everything is in a main div: <div id="MainDiv"> Here is the CSS #MainDiv { background-color:White; border:1px solid black; ma...

Ie 6, 7 and 8(Compatibility mode) issues

We have a site that works fine with any latest browser including ie8. But it has lots of issues with ie6, ie7 and ie8(Compatibility mode). We are using following doctype <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; So it is not using quirck mode. Before i start di...

CSS Cover link text with Image

<th> My Heading <a href="#" class="sort-asc" title="sort">Sort Asc</a> </th> I want to apply CSS to .sort-asc to replace the text "Sort Asc" with a custom 16x16 sort glyph image (/images/asc.png), placing the image directly to the right of the text. Is it possible? NOTE: I can't change the markup. I can only apply styles; the fo...