html

Apart from <script> tags, what should I strip to make sure user-entered HTML is safe?

I have an app that reprocesses HTML in order to do nice typography. Now, I want to put it up on the web to let users type in their text. So here's the question: I'm pretty sure that I want to remove the SCRIPT tag, plus closing tags like </form>. But what else should I remove to make it totally safe? ...

Vertical Wrapping in HTML

I'm looking for a good way to do a vertical wrap. My goal is to fit a list of checkboxes into a div. I have the checkboxes sorted alphabetically, and I want the list to flow from the top of the div to the bottom and then begin again in a new column when they reach the bottom. Right now, I can do this by breaking the list into chunks o...

Don't Repeat TFOOT When Printing

A table that extends onto multiple printed pages will have its thead and tfoot sections reprinted in firefox. This is usually great, however, is there a way to turn off this behavior with CSS? [UPDATE] Thanks for the response so far. I would like to have the tfoot print once at the bottom of the table but not at the end of each page. ...

asp.net mvc and css: Having menu tab stay highlighted on selection

Is there a better way to do this? I have an HTML helper extension method that checks if the current tab menu is the the selected one and then chooses .selected css class or not. I put the html.IsSelected link in each li as <li class="<%=Html.IsSelected(string a, string b)%>" > where a is the tab name and b is ViewData assigned. i...

How can I have a CSS hover affect a different tag?

Let's say I have the following: <style> .myLabel { color: blue;} .myLabel:hover {color:red;} </style> <div> <img src='myimage.png' /> <span class='myLabel'>Image Label</span> </div> Is it possible to replace the image (also via css) when they hover over the span? If so, how could I do that? ...

WBR Alternative in XHTML

I've been using tags in the thead cells for my tables, so I can control where browsers break long words. This works great, but its not XHTML compliant. What is the best alternative to using the wbr tag, that is valid XHTML? Example: <table> <thead> <tr><th>ThisIsAReally<wbr />LongWord<th></tr> </thead> <tbody> <tr><td>...

How can I escape special HTML characters in JSP?

Before I go and create a custom tag or Java method to do it, what is the standard way to escape HTML characters in JSP? I have a String object and I want to display it in the HTML so that it appears to the user as is. For example: String a = "Hello < World"; Would become: Hello &lt; World ...

Render markup on-the-fly or store html?

Any advice what has worked for you when dealing with user-entered markup, e.g. wiki or markdown. I have both CPU & database space costs, so I'm not sure which way to go. Store markup in database & render to html on the server for each pageview. (Less database space but more CPU usage) Store markup in database & render to html on the cl...

How do you post the contents of form to the page in which it is?

In Yahoo or Google and in many websites when you fill up a form and if your form has any errors it gets redirected to the same page. Note that the data in the form remains as it is. I mean the data in the text fields remains the same. I tried form action="(same page here)" method="post or get". It gets redirected to the page, but the con...

Submit an HTML form with empty checkboxes

Hi I have an HTML form - with PHP, I am sending the data of the form into a MySQL database. Some of the answers to the questions on the form have checkboxes. Obviously, the user does not have to tick all checkboxes for one question. I also want to make the other questions (including radio groups) optional. However, if I submit the form...

meta and img tags, generated in an xlt are not being closed correctly

I'm trying to get the meta and img tags to close in the output from an xlt. I've looked into it, and it seems I need to select an "xml" method rather than "html", but this still doesn't seem to work. I've currently got: <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL...

Generating and submitting a dynamic number of objects in a form with Django

I want to be able to update a dynamic number of objects within a single form using Django and I'm wondering what the best way to do this would be. An example of a similar situation may help. Model: class Customer(Model.models): name = models.CharField(max_length=100) active = models.BooleanField() Form (I know I'm mixing view...

Needed: flexible yet secure user HTML embedding technique

Hi, Our software manages libraries, museums, archives etc. We'd like to let the users (namely the catalogers, not the visitors) add some embedded content such as Google maps, YouTube videos etc. We'd like the solution to be as flexible as possible, as each embedded content provider has it's own format. OTOH, we'd rather not allow the us...

HTML: Submitting a form by pressing enter without a submit button

Well I am trying to submit a form by pressing enter but not displaying a submit button. I don't want to get into JavaScript if possible since I want everything to work on all browsers (the only JS way I know is with events). Right now the form looks like this: <form name="loginBox" target="#here" method="post"> <input name="usernam...

Div with scroll and content with absolute positions

I have a "div" with style: overflow-y: scroll; overflow-x: auto; I try to dynamicaly add image inside this "div" with absolute or relative position. Everything seems ok until user tries to scroll the "div" content: image stays in fixed position relative to browser window. This problem seems to be only in IE(7), in firefox everything is f...

Best web book for programmer?

I'm looking for the best books about web pages, but for the point of view of a programmer. I'm not looking for examples of good page navigation. I'm more interested into the technical information. For example HTML v3 vs v4 vs v5 (or even v4 vs v4.01). What are the most common meta tags and what do they do in each browsers. Common pitfall...

Link to resources inside WebView - iPhone

I have a webview in my iPhone application, and I also have some html files inside my Resources folder. When my app loads, I load in a page from my resources into my webview. But , I need to make links inside my webview that point to some other resources (For example, images, or other html files). Just doing a relative link doesn't work: ...

HtmlInputFile through post action

I have a web page which have 3 controls: form using the post command. in the form i have an input file control named "myFile". a button the upload process works just fine, until I'm trying to post the form and handle the upload in another form. Request["myFile"] and request.Params["myFile"] gave me nothing ...

Can I reformat HTML in Visual Studio without removing blank lines ?

The HTML formatting in Visual Studio works great -- especially considering you can pick a selection and just format that. You can just select a tag or block, right click and do 'Format Selection'. You can also reformat the whole document. However I like to use a lot of whitespace in my documents to keep things organized and the reformat...

Use of CODE tag in HTML, How to I get it to display the code?

Quick question, If I want to document some code on a basic HTML and put that within a CODE tag, how can I quickly convert the code between those tags when the page renders to display properly? I know I can write a javascript find and replace and search through the string over and over until its done replacing all the characters, but is t...