html

The opposite to an HTML conditional if statement?

In html you can include a file (such as a script or styletsheet) using for example. Is there a way to do 'if not', so I could include the file for all browsers except one? ...

Finding the content of HTML section document

This is not really a programming question, more of an algorithmic one. The problem: Finding the "content" section of an HTML page. By "content" I mean the dom that contains the page content as seen by humans, without the noise, simply the "page actual content". I know the problem is not well defined, but let's continue... For example ...

Disable Copy/Paste into HTML form using Javascript

Is there a way using Javascript to disable the ability to paste text into a text field on an HTML form? E.g. I have a simple registration form where the user is required to input their email twice. The second email entry is to verify there are no typos in the first email entry. However if the user copy/pastes their email then that def...

MVC HTML Editor

Can you recommend an WYSIWYG HTML Editor that works well with ASP.NET MVC? Any experience of the retail version of Obout's HTML Editor? ...

How can I get the TRUE height of a div?

I'm trying to determine the height of a div. This sounds simple, but is complicated by the fact that it's only descendant contents are floated, so asking for the height/outerHeight (using jQuery)/clientHeight/offsetHeight only returns 0, even though it's clear that on the page, it is rendered certainly with a height. Here is an example o...

editable datagrid with ability to clone individual rows

Im looking for a way to render an html table as an editable datgrid, with the ability to clone individual rows. I dont need to save any of the changes made, just superficially edit the cells because i then use a jquery plugin to scrape the table as is on screen and save it. Ive tried jeditable, but its designed for posting the output of...

can I update a label using ajax, instead of a textbox?

Hi, I'm using ajax to update a textbox once the value in a drop down box has been selected. However, i only update/put text in it if certain conditions are met, so it looks rubbish when there is no message. I was thinking that having a label there would be much better, but is this possible? Can i have an empty label and just update the ...

Disable keyboard in HTML SELECT tag

I want to disable the keyboard for an HTML SELECT tag so the user can only use a mouse to select the options. I've tried event.cancelBubble=true on the onkeydown, onkeyup and onkeypress events with no luck. Any ideas? ...

[html/javascript] - Download a picture OnClick

Hello everybody! How do you actually download a picture when you click on it? Is there some kind of a javascript code to do just that? Here is how i show the image with pure HTML. <a href="#"><img src="myPic.png" border="0"></a> ...

how to disable the entire dropdown control in html

i see there is a disabled property on a specific item in the dropdown list but is there an enabled property on the whole html dropdown itself? any suggestions? ...

Get Class List for Element with JQuery

Is there a way in JQuery to loop through or assign to an array all of the classes that are assigned to an element? ex. <div class="Lorem ipsum dolor_spec sit amet">Hello World!</div> I will be looking for a "special" class as in "dolor_spec" above. I know that I could use hasClass() but the actual class name may not necessarily be k...

gmail type filechooser for firefox

I have a simple requirement: One browse button opens multiple file choosers. When file is chosen, its filename gets added to an order list. This works just fine in IE, because i can programatically click on hidden file inputs, but firefox does not let the click event open the file choose dialog. Question: What options do i have? ...

Javascript function locating right element

This is partial markup: <tr class="Comment"> <td class="CommentCheck"> <input id="ctl00_col2_rptComments_ctl01_chkBox" type="checkbox" name="ctl00$col2$rptComments$ctl01$chkBox" /> <input type="hidden" name="ctl00$col2$rptComments$ctl01$hdnFldItemID" id="ctl00_col2_rptComments_ctl01_hdnFldItemID" value="35" ...

Smart HTML encoding

I'm looking for the best way to do some sort of "smart" HTML encoding. For instance: From: <a>Next >></a> to: <a>Next gt;gt;</a> From: <p><a><b><< Prev</b></a><br/><a>Next >></a></p> to: <p><a><b>&lt;&lt; Prev</b></a><br/><a>Next gt;gt;</a></p> So only the non XML / HTML part of the text would be encoded as if HtmlEncode is called. A...

Big clickable areas on a web page

Excuse me while I detach from reality.. I have a summary div which contains a small heading, a little bit of text, maybe an image. I'd like the whole summary div to be a link, something like this: <div class="summary"> <a href="#"> <h4>Small Heading</h4> <p>Small amount of text</p> </a> </div> I'd then style the href to lo...

RJS not updating html table elements

I have a link_to_remote function that updates columns in a table. However, it does not properly update the cell or its properties. For example: Here is the element I am updating: <div id= "calendar_div_<%= i%>_<%=j%>" style = "display :inline;"><td class="checkedout">X</td></div> Using this call: <%= link_to_remote 'Current Wee...

What is a Tool for Web Page Comparison?

Given the release of Microsoft Expression's Web 3 SuperPreview (very nice tool BTW), are there any tools that will compare two web addresses against each other? As in a way to compare dev to stage or something like that? Something with an overlay would be very nice. ...

How can I add an "Other" text input to a set of radio buttons in an HTML form?

I'm trying to create a form with a write-in "other" option as the last radio button. I've tried variants of the following with no success: <label><input type="radio" name="candidate" value="option1">First Option</label> <label><input type="radio" name="candidate" value="option2">Second Option</label> <label><input type="radio" name="ca...

New Background Image on each page reload

How can I display a new background image on each page refresh on a website (using Wordpress if this helps anything)? I would also like to take into account different screen resolutions, and proper handling for this. Any help would be greatly appreciated. ...

Sed - html replacement

Here is the input I have and the output I want: Input: <hr /> (newline) ( carriage return) (tabs, spaces)<div id="sidebar"> Output: </div> <hr /> (newline) ( carriage return) (tabs, spaces)<div id="sidebar"> This doesn't seem to match it: sed -i 's/<hr \/>[[:space:]]*<div id="sidebar">/<\/div><hr \/><div id="sidebar">/g...