html

Javascript force open a link in a browser

Hi, Is there a way to do object detection from JavaScript and force open a link in a specific browser? For eg: Open in IE, Open in Firefox TIA Raj ...

The select element should return 2 values.

I have a select box with options in it. The value of the options gets the id of the item that is displayed in each option. I do have an other value that should be linked on this option. Is there an easy way to do this? <select id="category" name="data[cat]"> <option value="12" label="0">A</option> <option value="7" label="0">B</option...

BeginForm in RC bug?

I think that there are something wrong with new RC, when i write Html.BeginForm("Item", "Newsletter", FormMethod.Post, new { enctype = "multipart/form-data" }) method must render in output something like this: <form action="/Newsletter/Item" enctype = "multipart/form-data" method="POST"></form> but instead of that im getting: <for...

text wrap of continuous text string

When I insert a continuous string of text in a fixed width "td", the text is not wrapping. Pls let me know why? Here are the links to the html pages. textstring with spacetextstring without space ...

Can I create a HTML table width a percentage height but pixel accurate row heights?

I need to create a table in a web page that has two rows. The table needs to fill the entire page so I have set the height and width of the table to 100% in the CSS stylesheet and the height of the html and body to 100% too. However, I need to top row of the table to be exactly 100 pixels in height and the second row to expand to fit th...

IE & Drop Down Menus triggering the Pop-Up Blocker

I have no idea why this is happening. I have some very straightforward code, replicated below, which works fine in all browsers except for IE 7 & 8. In those browsers, trying to expand the list of options in the select triggers the built-in Pop-up blocker bar. What gives? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "ht...

How does the location of a script tag in a page affect a javascript function that is defined in it?

I read that you should define your javascript functions in the <head> tag, but how does the location of the <script> (whether in the <head>, <body>, or any other tag) affect a javascript function. Specifically, I would like to know how does it affect the scope of the function and where you can call it from? ...

Should I use HTML 4.0 mark up for my email templates?

A designer coded an html template using CSS best practices. I want to use this template as an email newsletter template, but I've heard people say hotmail, yahoo and gmail offer limited support for CSS. Am I supposed to re-code these templates using table layouts and font tags? ...

Inserting Dates into HTML Table Cells

I am wanting to have a series of dates (mainly Month, Day, Year) displayed within a vertical arrangement of table cells on a web page. The first date needs to be the current date minus one day, with the next date in the sequence be the current date, The remaining dates need to incrementally be one day in future out to 16 days. Can som...

Produce heading hierarchy as ordered list

I've been pondering this for a while but cannot come up with a working solution. I can't even psuedo code it... Say, for example, you have a page with a heading structure like this: <h1>Heading level 1</h1> <h2>Sub heading #1</h2> <h2>Sub heading #2</h2> <h3>Sub Sub heading</h3> <h2>Sub heading #3</h2> ...

CSS precedence rules

Hi, My understanding is that there are 3 types of stylesheet: Defined by the page author Defined by the user (i.e. a set of default styles defined by the user and installed into their browser) Default stylesheet defined by the browser According to this book if an element is not matched by a selector in any of these stylesheets, only...

How can I make an HtmlTextWriter object use spaces instead of tabs for its Indents?

I am creating some html from code running on a WinForm. I want to create the following html: <html> <body> <div> <p>foo</p> </div> </body> </html> I'm using the System.Web.UI.HtmlTextWriter class to do this like so: System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(); htmlWriter.WriteFullBegin...

How to save user-entered line breaks from a TEXTAREA to a database?

Every time I try, it makes removes the line breaks. ...

jQuery Set Cursor Position in Text Area

How do you set the cursor position in a text field using jQuery? I've got a text field with content, and I want the users cursor to be positioned at a certain offset when they focus on the field. The code should look kind of like this: $('#input').focus(function() { $(this).setCursorPosition(4); }); What would the implementation o...

CSS: how can I force a long string (without any blank) to be wrapped in XUL and/or HTML

I have a long string (a DNA sequence). It does not contain any whitespace character. e.g.: ACTGATCGAGCTGAAGCGCAGTGCGATGCTTCGATGATGCTGACGATGCTACGATGCGAGCATCTACGATCAGTCGATGTAGCTAGTAGCATGTAGTGA what would be the css selector to force this text to be wrapped in an html:textarea or in a xul:textbox Thanks. ...

Firefox 2 - HTML button is just solid grey. All other browsers fine: wtf?

Hello all, I have a site that has a simple HTML button in a form. All browsers show this button correctly. However, in Firefox 2 and Seamonkey it appears just as a solid grey square that cannot be clicked on and that has no text. <input id="getaudiobutton" type="button" value="Get Audio" onclick="convert()" /> For those of you that h...

Memory consumption by CHtmlView MDI windows

I have found a problem with the MFC CHtmlView class in an MDI app. Repeatedly opening and closing windows causes a progressive drain on memory. I’ve researched the problem and found the MSDN article about the BSTR problem (http://support.microsoft.com/kb/241750), implemented those fixes, but there is still a large drain occurring. I’v...

CSS: wrap text around a bottom-right div?

Every time I try to do something seemingly-simple in CSS, it punches me in the gut and steals my lunch money :( I've been looking at this for over an hour and haven't made a bit of progress... I have a content div that contains a 460x160 image. All I want to do is position the image at the bottom-right corner and wrap my text around it...

Two Tables Same Height

I have a problem. I want two tables to have the same height. If the left table contain longer text than the right table i want it to be as long as the left table. This is how it looks now: http://i42.tinypic.com/34rwys1.png I cant set height because that would limit how much text you can write.. This is how i want it: http://i43.tinyp...

How to put focus on an element in jQuery?

Hi, I have done the following code in JavaScript to put focus on the particular element (branch1 is a element), document.location.href="#branch1"; But as I am also using jQuery in my web app, so I want to do the above code in jQuery. I have tried but don't know why its not working, $("#branch1").focus(); The above jquery (focus()...