How to fix a link to input type button if it doesn’t work in IE 7.0/8.0

If you use a form button (or input of button type, either one) within an anchor, instead of using text or creating a graphic. This link will work fine in across all other browsers but IE either 7.0 or 8.0. Even though the correct URL in the status line and the tooltip is showing, it DOES NOT initiate the link. The code is initially coded: <a href=”http://www.adomain.com/anypage.html”><input type=”button” name=”mybutton” value=”Click Me” class=”blue_btn”></a> There’re a few ways you can fix it. Method 1: Use form around…

Continue reading »

Change background of a row OnMouseOver

If you want to have the entire row/block to change the background color OnMouseOver, follow the instruction below. Step 1: Add 2 new classes in your style.css file. 1 class is “change_bg” which will behave when Mouse moved Over a row in a table. The other is “white_bg” which will behave when Mouse moved Out of that row. Step 2: Add the following codes to a row in the table or a <div> that you want it to change the behavior. <table width=”100%” border=”0″ cellspacing=”0″…

Continue reading »

How to Execute an HTML Form Using JavaScript

Most of websites nowadays have at least one form. In general, the form is executed when a user presses a submit/send button. However, sometimes, you may need to submit the form programmatically using JavaScript without the interaction of a user. User wouldn’t even know because the JavaScript executes in the back-end. JavaScript provides the form object that contains the submit() method. You will have to use the id or name of the form to get the form object. For example, if the name of your…

Continue reading »

Different ways to opening new windows using JavaScript

If you notice on most of the websites on the internet and inside most of web applications, you will find that opening a new window is a popular way of letting users/readers see additional information without navigating away from the current page. With JavaScript you can specify the dimensions, position and visible toolbars of this newly created window, as well as writing code directly into it and having the two windows operating together. To this aspect of modern web engineering, I will show you multiple…

Continue reading »

Preload multiple images on a webpage

In order to speed up a web page with a lot of images, you can use JavaScript to plug on that page. In the <head> tag, use the following script: function preload_images(){ var Img = new Array(); Img[0]= “ser_remodeling_pop.jpg”; Img[1]= “ser_indoor_pop.jpg”; Img[2]= “ser_outdoor_pop.jpg”; Img[3]= “ser_newconstruction_pop.jpg”; Img[4]= “ser_additions_pop.jpg”; Img[5]= “ser_breakerpanel_pop.jpg”; Img[6]= “ser_electricityupgrades_pop.jpg”; Img[7]= “ser_conversion_pop.jpg”; Img[8]= “ser_codecompliance_pop.jpg”; Img[9]= “ser_troubleshooting_pop.jpg”; var imageObj = new Image(250,167); for(var i=0; i

Continue reading »