html

Generating HTML email body in C#

Is there a better way to generate HTML email in C# (for sending via System.Net.Mail), than using a Stringbuilder to do the following: string userName = "John Doe"; StringBuilder mailBody = new StringBuilder(); mailBody.AppendFormat("<h1>Heading Here</h1>"); mailBody.AppendFormat("Dear {0}," userName); mailBody.AppendFormat("<br />"); ma...

Border around 100% body height and width (HTML 4.01 Strict)

Okay, this is driving me crazy right now. I want to have a border around my document. It should be nicely going around the whole window/viewport. So I define: body { border: 1px solid red; } When my document is in quirks mode, this works fine. At least in IE, which is my primary target here. A red border shows up at the very edges ...

Do I need to do string sanitation before adding to DOM?

In our team we came up with the idea that we have to do sanitizing of strings before added to the DOM. We expected at least that double quotes would be troublesome if used in setAttribute and < and > if added to the node content. The first tests showed something different. We are using innerHTML to set a nodes content. This escapes all ...

getting href value of from <a> tag

hi, I have below html: <div class="threeimages" id="txtCss"> <a> <img alt="Australia" src="/Images/Services%20button_tcm7-9688.gif"/> </a> <div class="text" id="txtLink"> <h2> <a href="/partnerzone/downloadarea/school-information/australia/index.aspx">Australia</a> </h2> ...

Lining up text fields

How do I line up textfields so they look more neat? At the moment I've got: <div id="content"> <h2>Change password</h2> <% form_tag({:action => "change_password"}, :method => "post") do %> <%= @error %> <div class="form_row"> <label for="current_password">Current password:</label> <%= password_field_tag 'curre...

How to display xml response already formatted in html (IE won't show anything after the xml table)

How to display xml response already formatted in html (IE won't show anything after the xml table) If you visit this page in IE you'll see that nothing displays after the chart: http://www.ratecatcher.com/prototype.htm Here is the main php code: $xml = file_get_contents($request); echo html_entity_decode($xml); Then the html that is...

Hidden radio button but box around it in ie8

Hello, I have style my radio buttons with a background image, basically what i have done is <input type="radio" id="btn" name="btn" style="opacity: 0;filter: alpha(opacity = 0);position:absolute;"> <label for="btn">My Text</label> <!--- added styles to it ---> with this i get output something like this Image1 that shows how the disp...

How do I center a div and make it expand around the divs inside of it?

I have a page that I want centered, with a background and a border around the entire content. I made a div and set it with the background color and the border settings I want. Problem is that it has divs inside it that float and the background does not stretch around the floating divs. The only way I was able to get it to work was by s...

How to read <object> <PARAM> properties in ActiveX web control with VC++/MFC

Hi, I have ActiveX control done in VC++/MFC. It embeds into html web page. Now I need to be able to configure it by providing parameters in html tag. like: The question is how do I read those parameters during my ActiveX initialization? My research revealed that it has to be done through IPersistPropertyBag interface, but I cou...

Regex to capture variables

I am trying to use an HTML form and javascript (i mention this, because some advanced features of regex processing are not available when using it on javascript) to acomplish the following: feed the form some text, and use a regex to look into it and "capture" certain parts of it to be used as variables... i.e. the text is: "abcde ...

Web Dev Primer

Before reading JavaScript books, what is a good resource for learning HTML and CSS? I'm looking for material that will get me up to speed rather than specify every single compliance standard. So, concepts that are prerequisites for exploring JavaScript. I've done basic web development for about 6 months (HTML/CSS, ASP.Net) but my approac...

Ensure a form is posted using zip

I have a form that is posting a pretty long string (60k) that is highly compressible. I would like to ensure that the browser encodes the form data in a zip format to reduce the network bandwidth required, however I am not sure how to do that. Can someone point me in the right direction. ...

How to get current page size in KB using just javascript?

Referring to this question , how can i get the current page size in kb, this size i will use to know the connection speed for this page. ...

Installable CMS similar to CushyCMS?

Hello, I'm looking for a CMS system that works similar to CushyCMS, but that I can install on my own server? I love the functionality and ease of use CushyCMS provides for simple, small sites where setting up and installing a traditional CMS (Drupal, Wordpress, TYPO3) are not necessary. Anyone have any ideas? Thanks! Troy ...

Wrap a long string in rails while preserving urls

In my rails project I have the following code auto_link( h( wrap_long_string(post.text,50) )).gsub(/\n/,"<br />") wrap_long_string is defined as: def wrap_long_string(txt,col = 20) txt.gsub(/(.{1,#{col}})( +|$\n?)|(.{1,#{col}})/, "\\1\\3\n") end This code is meant to display user entered text while preventing users f...

Access document of new window in chrome

My goal is to submit a form in a new window. I'm using the following code: var xmlWindow = window.open("getXML.htm"); xmlWindow.document.getElementById("getXML").action = "getData.asp"; xmlWindow.document.getElementById("getXML").method = "post"; xmlWindow.document.getElementById("getXML").innerHTML = "<input type='hidden' name='moduleI...

<table> for layouts is evil right?

Hi, Just found out that this site uses tables for layouts. Does anyone find this disturbing considering the nature of the site? I really don't know what to believe anymore :-) http://www.w3schools.com/ ...

How to avoid the mailto annoyance?

I am working on a website and would like for my users to be able to give feedback as easily as possible. I know one way but I've always hated it: <a href="mailto:[email protected]">Click Here to be annoyed!</a> Is there a way in JavaScript or HTML to allow my users to email me without having to go through a lot of trouble? ...

how to submit a form that will have dynamically (unknown) number of fields

I am trying to submit a form to a servlet (java). The form has a bunch of questions, each question has 4 radio buttons and the user selects one of them. I do not know the number of questions that will be in the form. It could be 10, 15, 12...depends on some other criterias. My question is what is the best way to retrieve the list of ...

XML to XML using XSLT

I am trying to create a new XML file from an exisiting one using XSL. When writing the new file, I want to mask data appearing in the accountname field. This is how my XML looks like: <?xml version="1.0" encoding="UTF-8"?> <Sumit> <AccountName>Sumit</AccountName> <CCT_datasetT id="Table"> <row> <CCTTitle2>Titl...