html

mouse event problem with nested elements

I have something similar to the following: <div onclick="divClickEvent();"> <img onmousedown="imgOnDownEvent();" /> </div> The problem is that if you mouse down on the img, the div click fires on mouse up. I tried to override the div onclick by adding an onclick="return false;" to the img element, but the div onclick is still fir...

Javascript validation of date select boxes

Hi, I have created 3 select boxes containing days, months and year. What I really would like is to check after the user has selected a date, if the date is over a year from the current date a message is displayed or so. Im a little stumped on what to do. Any gidance would be great. Thanks ...

What is .tpl files? php, web design

Hi guys! A man wants me to redesign a site run in PHP (VideoCMS). But when I asked him to send me the source he has given me *.tpl files instead of *.php. There is some code inside them: {include file='header.tpl' p="article"} <br /> <table width="886" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="150" valign="top...

Simple html css block structure, can't use -headerHeight bottom-margin for content div to avoid scrollbar?

The following is my simple html/css structure: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> <title>de titel</title> <style type="text/css"> * { color: #FFFFFF; margin: 0; padding: 0; } html, body { heigh...

Several simple select boxes to replace a multiple select box in HTML

I'd like to replace a multiple select box like: <select multiple="multiple" name="options"> <option value="option1">option1</option> <option value="option2">option2</option> ... </select> with an arbitrary number of simple select boxes: <select name="options1"> <option value="option1">option1</option> <option value="o...

Cannot use space in XMLElementName

Hi, I am using XMLwriter to create HTML which works well, but now I need to place image tag but I am not able to do that - it still reports I cannot use ' ' in the element name. Please advice hwo to solve that, thanks! EDIT: Basically, how to create in XML document this: <img src="path" /> ...

Creating new tab / switching between Tabs in Firefox?

I am looking for a way to improve the workflow in a PHP based CMS. There is a lot of switching between the editor mode and the preview mode of the page. The editor mode is huge to load, and so I would like to open the preview mode in a different window. I don't want to use new windows or an iframe within the current window to keep the w...

Getting error when INSERT into MySQL.

_mysql_exceptions.Warning: Incorrect string value: '\xE7\xB9\x81\xE9\xAB\x94...' for column 'html' at row 1 def getSource(theurl, moved = 0): if moved == 1: theurl = urllib2.urlopen(theurl).geturl() urlReq = urllib2.Request(theurl) urlReq.add_header('User-Agent',random.choice(agents)) urlResponse = urllib2.urlop...

What is the default content-type/charset?

According to this answer: http://stackoverflow.com/questions/1020892/python-urllib2-read-to-unicode I have to get the content-type in order to change to unicode. However, some websites don't have a "charset". For example, the ['content-type'] for this page is "text/html". http://bit.ly/6IcCtf/ I can't convert it to unicode. encodi...

Why is this javascript not working?

This is in continuation of the question: http://stackoverflow.com/questions/1801960/innerhtml-working-in-ff-but-not-in-ie The above problem is resolved [ thanx to pygorex1 ] . But i would like to know why the following code snippet is not working. if (window.addEventListener){ window.addEventListener('load', addDateFormatIn...

open source web based WYSIWYG editor, drag drop controls on form

I wonder if there is any open source web base WYSIWYG editor in ASP.net, which allows drag and drop html controls in the web browser and alows us to design web forms? Regards, Nitin Sawant ...

Inline CSS/Javascript into a HTML file

I am looking for a simple commandline script/program to automatically "inline" all external css and javascript references for a html file. I basically want to create a single self-contained html file suitable for sending via E-Mail. An additional bonus would be if it could also inline images as data: UIRs, but that part is not so importa...

How to avoid a SAXParseException using Xerces when HTML file includes mdash?

I am using the Xerces implementation within JDK6 to perform XPath queries on an HTML 4.0 transitional document. With the following code: XPath newXPath = XPathFactory.newInstance().newXPath(); XPathExpression xpathExpr = newXPath.compile(expression); Object xPathResult = xpathExpr.evaluate(inputSource, XPathConstants.NODESET); Where...

How can you dynamically generate list items to an unordered list in ASP.NET?

I have an error panel that is subbed in to a page if an error goes wrong to gracefully handle and display errors. Currently, I am just appending the error messages to a string and pushing that to a label. If you have multiple errors, this gets messy. Therefore, I'd like to push each error to a list item in a bulleted, unordered list. ...

Mouse Over listener for FlexTable in GWT 1.7?

How do you add an event listener or handler to widgets in GWT 1.7? I know there are some questions alreayd about this on SO but it seems they are outdated. For example (ignoring the fact that there is a :hover in CSS) how do I add a Hover listener to a FlexTable for example? ...

View GWT HTML source?

Is there a way to VIEW the HTML source code that GWT produces? Currently I just give my flex table the DIV id and that DIV is all HTML I can see in ViewSource. Is there a way to structure my table in HTML (say using div's and lists) and than create a something like FlexTable around that? ...

Post the checkboxes that are unchecked

I've got a load of checkboxes that are by default checked. My users will probably uncheck a few of the checkboxes (if any) and leave the rest of them checked. Is there any way to get the checkboxes that are NOT checked in a form post, rather than the ones that are checked? ...

How to get the number of results found for a keyword in google

I need to supply a keyword like "blue metal kettle" (with/without quotes) and get only the number of results found for this search. If I search without quotes right now, I get: Results 1 - 10 of about 1,040,000 for blue metal kettle. (0.19 seconds) Here '1,040,000' is the number I want. Is there any API function to do this, or I must...

css file path is right, css codes are valid, but it doesn't work

I have a weird, annoying problem. I have a css/ folder and index.html at the root. I load css files in the header as follows: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> ...

Converting drop-down select input to radio buttons which require one to be chosen

I'm using an e-commerce system which allows you to have several variations for each product - (for instance: large, medium, small t-shirts). However, we are having complaints from customers who add a t-shirt and ignore the variation. As a result, a lot of big people are getting small t-shirts (the default). To solve this, I'd like to for...