518 Posted Topics
Re: You can try this one... [code=javascript]<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <title>Demo</title> <style type="text/css"> /* <![CDATA[ */ html, body { min-width: 800px; max-width: 1024px; width: auto; } … | |
Re: I really don't understand what you are trying to achieve here! But you can refresh the page with this bits of code: [code=html]<input type="button" value="refresh" onclick="window.location.reload();" />[/code] ![]() | |
Re: Im not sure if this is what you need. But may be this wil claim your issue, simply insert the code below, between the [b]head[/b] section of your page: [code=javascript]<script type="text/javascript"> <!-- window.onload = function(e) { try { var askThem = ( confirm('Do you wish to load any popup's from … | |
Re: This code is basic as needed. You are free to modify this according to what purpose you need. Hope it helps and good day to you... [code=javascript]<?xml version="1.0" encoding="UTF-8"?> <?xml-sylesheet type="text/css" href="#internal"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> … | |
Re: Yeah i agree to kanaku's point. But since we all have it here. I'l throw a simple demo regarding this issue. [code=html]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title>Creatingt Simple table Using JavaScript</title> <script type="text/javascript"> <!-- function tableSamp() { … | |
Re: Here's a quick example. Assuming that you have this external style sheet in your directory [b]default.css[/b] -- and the rules would be: [code=css]ul { list-style-type: none; line-height: 140%; margin-left: 1em; width: 100%; } li { display: inline; margin: 0.8em 0 0 0.8em; padding-left: 0.5em; line-height: 140%; width: auto; } li … | |
Re: Hope this will help u up! [code=html]<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <title>Centering The Page</title> <style type="text/css" media="all"> /* <![CDATA[ */ @media screen { html, body { height: 100%; min-width: 800px; max-width: … | |
[color=red][b]Merry x-mas to everbody![/b][/color] May you have all the blessings in life and good health... | |
Re: Things can be done with CSS. But here's a basic example to get you started... [code]<img src="yourImage.jpg" alt="[ Home ]" id="image1" onmouseover="this.src='home.jpg';" onmouseout="this.src='myImage.jpg';" /><br /> <a href="#" onmouseover="document.getElementById('image1').src='home.jpg';" onmouseout="document.getElementById('image1').src='yourImage.jpg';">Hoover Me!</a>[/code] | |
Re: Hope this example will give you some idea on how to validate fields' using regExp()... [code=javascript]<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="#myStyle" media="all"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Validate the field</title> <style id="myStyle" type="text/css"> /* <![CDATA[ */ @media screen { body { width: … | |
Re: Try this one... [code=html]<a title="" href="javascript:void(0);" onclick="window.open ('my_page.htm',target='_blank','width=500,height=500,toolbar=no,scrollbars=no,menubar=no,status=no,location=no');"> <img border="0" src="test.gif"></a>[/code] | |
Re: Here you have it... Hope this will solve the issue... [code=javascript]<html> <head> <title>javascript1</title> </head> <script lnaguage="javascript"> function Init() { var table = document.createElement("tbody"); var newrow,newcol,tmp; var array = new Array(16); for (var i=0 ; i<16 ; i++) array[i] = 0; for (var row = 0 ; row <4 ; row++) … | |
Re: Hi there, i've come up with a lite modification in your code! Hope this will help you out... [code=html]<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="#myStyle" media="all"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Try to Avoid using Absolute Width</title> <style id="myStyle" type="text/css"> /* <![CDATA[ */ … | |
Re: A CSS based drop down menu would aide you from this issue. Try the HTML/CSS section am sure they will be happy to help you from there. | |
Re: Hope this will add a few ideas' in your coding technique... This simple script will generate random quotes' each time you reload or open up the page! [code=javascript]<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Random Quotes</title> <script type="text/javascript"> /* <![CDATA[ */ … | |
Re: Or you can just simplify things by doing this: [code=html]<form name="myform27" action="#" onsubmit="return false;"> <label for="chk1"> <input type="checkbox" name"myCheck" id="chk1" onmouseover="if (!this.checked) { this.checked = true; } else { this.checked = false; }" />Checkbox</label> </form>[/code] | |
Re: Hope this will help you up! This example will display all images on the fixed width of 130pixel. The Image i used is included on this demo. See the attached file. [code=javascript]<html> <head> <title><!--Sample--></title> <style type="text/css"> <!-- #wrapper { width: 560px; margin: 0; padding: 0; text-align: center; } #content { … | |
Re: [b]HTML[/b] itself can provide you all the elements you need. But with dynamic changes, you will be needing some script for this to generate the output you need. Perhaps you can start with [b]DHTML[/b]. | |
Re: You may also try this to skip the coding... [icode]<form action="#" onsubmit="return false;"> <input type="text" value="Email" name="Email" style="color:grey;text-align:left;background:white" onfocus="this.style.color = '#000';" onblur="this.style.color = '#aaa';" /> </form> [/icode] | |
Re: All can be done with CSS by partialy putting all elements and nesting them within the [icode]div[/icode] container. | |
Re: Use the sort() method, this will sort an Array alphabetically. If you would like to create your own sorting criteria, supply a function for the sort method to call. Sort will pass your function (a,b). If a is less than b then return -1, if a is equal to b … | |
Re: If you will consider my advice, then the easiest way, is to show all information with just one container instead of making those 3 elements disappear. The following demo will show you how things will work. This Markup is a [url=http://validator.w3.org/]Valid xHTML 1.0 Strict[/url] and also validates using [url=http://jigsaw.w3.org/css-validator/]CSS Level … | |
Re: I've gone into lite modification in your code. This document is a valid [url=http://validator.w3.org/]HTML 4.01 Transitional[/url] [code=javascript]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title><!--Sample--></title> <style type="text/css"> <!-- .style1 { font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #142f57; } .name { font-size: 14px; font-family: Arial, Helvetica, sans-serif; color:#255ba8; … | |
Re: You may try this instead! Enjoy coding... [code=html]<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Change style</title>[/code] [code=javascript]<script type="text/javascript"> <!-- BEGING HIDING function changeStyle(change) { if ( change ) { document.body.style.backgroundColor = '#000000'; document.body.style.color = '#FFFFFF'; } else { document.body.style.backgroundColor = '#C0C0C0'; document.body.style.color … | |
Re: Yes it can be done with the help of css. I wil play a simple demo to clear things up! Asuming that you have 2 media print1.css and print2.css, With print1.css you have the following attribution [icode] html { width: 1024px; height: 100%; } body { font: 700 16px Arial, … | |
Re: Hope that this will help you up... [code=javascript]<html> <head> <title>Calculator</title> <script type="text/javascript"> function numberReader() { x = []; n = prompt('Enter a number that is separated by "space" or ","',''); m = n.replace(/(\s)|(\,)/g, '').slice(); for ( var i = 0; i < m.length; i++) { x[i] = m[i]; } document.write((x[0]*1 … | |
Re: Just a quick brief regarding arrays. Since an Array can store other Arrays you can get the benefit of multi-dimension arrays. [icode]var x=[0,1,2,3,4,5]; var y=[x];[/icode] In the above example i've created an array named "[b]x[/b]" and assigned it as the first element in the array "[b]y[/b]". If we ask for … | |
Re: This will do it! The value of the input box retrieved, and the output division updated. Creating HTML and inserting it into the document which means that html tags you typed will be appropriately processed. Hope it helps... [code=javascript]<html> <head> <title><!--Sample--></title> <style type="text/css"> <!-- @media screen, handheld { html, body … | |
Re: A quick throw over this 1. Hope it will help you all the way... [code=javascript]<html> <head> <title><!--Sample--></title> <style type="text/css"> <!-- body { font-family: Arial, Verdana; font-size: 10pt; color: #696969; text-align: left; } form span { display: block; margin: 25px 0 10px 5px; font: 700 18px Verdana, Helvetica, Arial, sans-serif; } … | |
Re: If you have a floating elements next to --> [icode]document.getElementById ("divid");[/icode] just simply add this up --> [code=javscript]document.getElementById ("divid").style.display="block"; document.getElementById ("divid").style.float= "left"; /* It's up to you to set things up wheather it's left, right or center floated */ document.getElementById ("divid").style.clear= "both"; [/code] | |
Re: You can do it this way... Simply insert this bits of code inside the head section of your default page... [code=javascript]<script type="text/javascript"> <!-- /* To ensure that it will be loaded with appropriate ext. */ window.onload = function() { window.location = 'http://www.yourdomain.com'; } //--> </script>[/code] | |
Re: You may try this code, i've done a lite modification over you script. Hope you find it useful... [code=javascript]<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>Collapsible Panel Test</title> <style type="text/css"> <!-- body { font: 70%/1.5em Arial, sans-serif; color: #696969; text-align: left; } h3 { font: 700 16px Arial; color: #181818; } … | |
Re: Am not sure if this what you need. But this wil help you to get familiar with confirm boxes. Feel free modify this script according to your needs... [code=javascript]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang = "en" dir="ltr"> <head> <title>Exit Row Requirements</title> <meta http-equiv="content-type" content="text/html; … | |
Re: Let's play a simple demo, hope you find this useful... [code=html]<html> <head> <title><!--Sample--></title>[/code] [code=css]<style type="text/css"> @media handheld, print { body { width: 50%; height: 50%; font-size: 11px; background-color: #FFFFFF !important; } } @media screen { body { background-color: #F6F6F6; color: #696969; font-size: 70%; font-family: Verdana,Helvetica, Arial, Sans-Serif; text-align: left; } … | |
Re: Maybe this would help. Try to use the css hack to fix rendering problem. As we can see to it, that in pre-IE browsers on PC, where by the border and padding are included in the width of an element, as opposed to added on. For example, when specifying the … | |
Re: CSS-based websites to look the same across all browsers can often be difficult. Many of the problems however lie with Internet Explorer implementing CSS commands differently to other, more standards compliant browsers. All is not lost, however, as many of the differences you see across browsers are caused by the … | |
Re: Since i don't have any reference in your code. I will just play a simple demo based on what you wanted to happend. Here's the basic to deal with it... [code=javascript]<html> <head> <title><!--Sample--></title> <script type="text/javascript"> <!-- document.onclick = function(e) { e = e ? e : window.event; t = e.target … | |
Re: Hope you'll enjoy my simple demo, on how to get around with prompt boxes. Good day... [code=javascript]<html> <head> <title><!--Sample--></title> <script type="text/javascript"> <!-- function abc() { var validValue = /^[1-9]{1,4}$/; var openValue = /[0-9]/; var a = prompt('What is a's value?', 'Value goes here!'); do { if (!validValue.test(a)) { alert('You must … | |
Re: Here's what you need. I've added some span elements to control the portion of the text. Hope this will help you up. Enjoy [code=html]<html> <head> <title></title> <style type="text/css"> .cards { width: 537px; height: 140px; float: left; margin: 0; padding: 0; background: #66AAFF; overflow: hidden; } .cards ul { list-style-type: none; … | |
Re: Here's a simple demo, to get you started! [code=javascript]<html> <head> <title><!--Sample--></title> <script language="JavaScript"type="text/javascript"> <!-- function createDiv() { var _body = document.getElementsByTagName('body') [0]; var _div = document.createElement('div'); var _text = document.createTextNode('Creating Div Element') _div.appendChild(_text); _body.appendChild(_div); } window.onload = createDiv; --> </script> </head> <body> </body> </html>[/code] If you need something else just … | |
Re: Javasript wont be necessary for this one. CSS wil do fine and here's the actual code and along with your image. Just dont forget to polish the styles according to your needs. [code=css]<html> <head> <title><!--Sample--></title> <style type="text/css"> <!-- body { margin: 10px 0 0 0; padding: 0; text-align: center; background: … | |
Re: Am not sure if this is what you need. [code=html]<!-- Assuming that this the targeted frame in your page --> <iframe id="frame1" src="myPage.html" width="700" height="700"></iframe> <FORM><INPUT TYPE="BUTTON" VALUE="Go Back" ONCLICK="document.getElementById('frame1').contentWindow.location = 'someLocation.html';"></FORM> <!-- Just another option --> <FORM><INPUT TYPE="BUTTON" VALUE="Go Back" ONCLICK="document.getElementById('frame1').src = 'someLocation.html';"></FORM>[/code] | |
Re: Here you have it! [code=javascript]<html> <head> <title><!--Sample--></title> <style type="text/css"> <!-- body { margin: 16px 0px 4px 0px; padding: 10px; font: bold 12px/80% Verdana, sans-serif, Arial; color: DeepSkyBlue; text-align: center; } #wrapper { margin: 0px; padding: 0px; width: 700px; } #contents { display: block; clear: both; padding: 4px ; line-height: 20px; … | |
Re: Try to recall all the lines of your code! [code=javascript]function emailchk () { //Refering to what value?--> if (!document.getElementById("email").value) { document.getElementById("emailmsg").innerHTML = " "; } else { url = "emailchk.php?email=" + document.getElementById("email").value; //Missing curly!--> } //So we'l have to add our end curly for this block! if (window.XMLHttpRequest) { xhr … | |
Re: It's better if we will use the onchange event for this function! Here's the code: [code=javascript]<html> <head> <title><!-- Sample --></title> <script type="text/javascript"> <!-- function editBox(id,name,e) { e = e ? e : window.event; t = e.target ? e.target : e.srcElement; thisValue = document.getElementById(id); if ((t.name) && (t.name == name)) { … | |
Re: This may come in handy! [code=html]<html> <head> <title><!-- Sample --></title>[/code] [code=javascript]<script type="text/javascript"> <!-- function scrollDown() { t = form1.list; for ( var x = 0; x <= t.options.length; x++ ) { t.options[x].selected = true; } } window.onload = function() { var el = document.getElementsByTagName('option'); for ( var i = 0; … | |
Re: Simply add the following lines in your code... [code=javascript]//Additional lines starts here --> if (document.all && !document.layers) { document.all.linkout.href = urlout; document.all.linkout2.href = urlout; } else { //Preserved Lines --> document.getElementById ('linkout').href = urlout; document.getElementById ('linkout2').href =urlout; } } // Additional lines --> if (window.addEventListener) window.addEventListener('load',link,false); else if (window.attachEvent) window.attachEvent('onload',link); … | |
Re: Here you go! Hope that this will solved the issue... [code=javascript]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Gross Pay Amount</title> <script type="text/javascript"> <!-- /* Assuming that this is an external srcript */ function thisPrompt() { var nVal = /^[0-9]{1,4}[\.\d]{0,2}$/; do { var h … | |
Re: Simply Insert this inside the [icode]<head>[/icode] section of your page! [code=javascript]<script type="text/javascript"> <!-- var thisName = /^[A-Za-z]{3,50}$/ var validEmail = /^(\w+[\-\.])*\w+@(\w+\.)+[A-Za-z]+$/; var zip = /^[0-9]{4,10}$/; document.onsubmit = function(e) { e = e ? e : window.event; t = e.target ? e.target : e.srcElement; var info = []; if (( t.name … | |
Re: Here you have it! I've done a lite modification in your code! [code=javascript]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Calculate Gas Mileage</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript"> /* <![CDATA[ */ var validValue = /^[0-9]{1,4}$/; function calcMPG() { var startMiles = document.mpgform.startingMileage.value * 1; var … |
The End.