html

How to prevent IE from loading hidden content using HTML/CSS only?

When you set an html element to have display: none, the content inside that element (e.g. images and flash) wont be loaded by Firefox until the element is set to be displayed. But Internet Explorer dont behave like that. It loads everything inside hidden elements from start. Is there a way to prevent IE from loading such content without...

jQuery How to move an element into another element?

I would like to move one DIV element inside another. For example, I want to move this (including all children): <div id="ctl00_c1_vw_Module_SectionAssociation_pnl1" class="i-panel"> ... </div> into this: <div id="sectionassociation-i-panel" class="i-panel"> ... </div> so that I have this: <div id="sectionassociation-i-panel" class...

How do you clear an HTML form on page reload but not when the user navigates BACK to the page?

I am using the trick where you store some data in a hidden form in order to be able to be able to persist it so that when the user navigates away from the page and then uses the BACK button to come back I can restore the data to the page without hitting the server again... However, this trick means that the same thing happens when the ...

CSS Positioning inside of an HTML Table

I feel like this should be a no brainer, but clearly I'm missing something... I'm stuck with an HTML table on a page, and need to absolutely position an element that is rendered inside of the table so that it can display properly when we apply DHTML to show it. I tried absolutely positioning it relative to the bottom of a table row, bu...

Whats the best way to output data from a database using php?

I'm relatively new to php, and I'm working on a project using a mysql database. The project consists of users being able to write posts, which are then shown in a list format. The problem is, the posts are shown in different locations on the site, like the index (main) page, and the users profile page. Similar to twitter if you're confus...

HTML tables to PDF in PHP - neither DOMPDF nor html2ps/pdf are working

For the longest time now I've been trying to convert HTML pages containing large tables to PHP. These are styled with CSS and can be several pages long. I first tried DOMPDF. It works great, until a document is more than one page. None of the fixes I've found work. Either it errors out, or any element that would be even partially on the...

Whats the right way to label things in a form?

I've seen lots of ways to label things in a form such as <label>, <div>, <span>, etc. Is there a right or wrong answer for this? Are there any advantages/disadvantages to any of these? Thank You ...

IE Stretching My <div> to 100% Width

I've been working on div with rounded corners. I've got it displaying properly in everything except IE (testing with 7). In every other browser, the div's width fits only the elements inside, just as intended. In IE, however, the width of the div is 100% of the page. I've searched a bit, but could only find information regarding IE issue...

repeating id's of element children

Is it ok to have id names for children of an element the same as the ids of children of another element provided the parent id is different? Any potential conflict? ...

Problem Embedding External JavaScript in HTML page

I am trying to embed a 3rd party chart (Twist) into an HTML page. Also on the HTML page, I am using a text input to allow for a user to dynamically enter new parameters to be sent to Twist. In javascript, I am attempting to append the text input to the end of the call to the external chart. I cannot, however, figure out how to have ...

Given an x,y coordinate, I need to find all html elements underneath it.

I am building an app where I repeatedly need to get lists of html elements sitting under a specific location (x,y relative to the viewport, e.g.). I am considering the following approaches, but none are satisfying: (1) Go through the html, build a data-structure that keeps track of the x,y position of every element (x,y -> set of eleme...

Lightweight Rich Text Editor

I am looking for something very simlar to the SO WMD markdown editor that is extremely lightweight but I would like the text area to display the "preview" as you type. I have looked into many Rich editors but they are all seem to do everything under the sun. All I really want is Bold, Italic, Link, Image, and Lists (ordered/unordered). ...

How do I run PHP code when a user clicks on a link?

I want to have a page run some PHP code when a user clicks on a link, without redirecting them. Is this possible with <a href=""></a> or with the javascript onclick event? ...

How do I loop through MySQL results easily?

I've been requesting MySQL results and looping through them like this: $query = "SELECT * FROM $table"; $result = mysql_query($query); for($i = 0; $i < mysql_num_rows($result); $i++){ echo mysql_result($result, $i, $row); //do something else; } you can probably see what happens. What if a row has been deleted? What if the firs...

javascript onmouseout applied to div fired by children

Hi I'm having trouble finding a solution to this via google but I would have assumed it would be quite a common problem. I have a div which I have applied an onmouseout event handler to (the handler is used to roll a menu up using jquerys "slideup" function, as I would like the menu to be hidden when the mouse leaves). Problem is that t...

Send forms to seperate pages for handling, or back to the same page?

Is it better to send an html form to a seperate page, or send it back to the same page?? i keep hearing to seperate logic from presentation, so I was wondering if I should seperate my forms from my form handlers as well. As of now, Im doing this... <?php if(isset($_POST['submitted'])){ //Validate the form if(empty($_POST['name'...

place inputbox at the center of div

i have a div.I want the input box to place at its center .how can i do this?? ...

Getting live content

Hi, how can i get the content on enviroment agency website to load up on my site. i want the current flood warnings so the users of the site can see them The warnings are at http://www.environment-agency.gov.uk/homeandleisure/floods/31618.aspx Nothing i do seems to work, can get them there but not change on page refresh as they chang o...

Query relating positon of the dropdown menu withrespect to the size of the browser

Hi , i m usin a vertical deopdown menu for my website .i had set its top and left attrtibutes in pixel to fix its position according to its parent elements postion.but when i reduce the size of the browser the dropdown menu remains at the same positon where it was when the browser was at its full size.can u helpme with that. if posible p...

How to add custom text input to images dynamically

Could any one please give me pointers as to how one can add text to images dynamically. For example a person fills up text form and selects an image . Then after clicking the submit button the text input by the visitor gets added to the image. To understand it better please check : http://www.vistaprint.com/ . In this site this has been ...