518 Posted Topics

Member Avatar for goodluck4287

You can also try this demo. [code=javascript]<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="#internal-style"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html id="xhtml10" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=5; IE=EmulateIE7; IE=8" /> <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>Countdown timer to hide my …

Member Avatar for essential
0
170
Member Avatar for jyotiu

Try this one: [code=javascript]<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="#internal-style" 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> <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>Change The Image With Colours</title> <style id="internal-style" type="text/css" media="all"> /* <![CDATA[ */ html, body, …

Member Avatar for nickfday
0
135
Member Avatar for 88omar

You'll have to take some recaps in your code! This is a line-breaking errors and missing semicolon's. I'll point something out that starts on this declaration: [icode]var name,namelength // instead of this >> var name, namelength;[/icode] I'l provide you something useful, please check [url=http://www.jslint.com/]THIS LINK![/url]. It's a tool that validates …

Member Avatar for 88omar
0
92
Member Avatar for samarudge

Try to use id's that starts in a lower case, and apply this code to ensure that it will execute in IE browsers. [code=javascript]function s_et() { var ua = (document.all) ? document.all.search_content : document.getElementById('search_content'); if ( ua ) ua.innerHTML = search; }[/code]

Member Avatar for almostbob
0
148
Member Avatar for kavithakesav

Insert this in the header section of your (x)HTML document(s). [code=javascript]<script type="text/javascript"> <!-- window.onload = function() { try { window.open('yourdesiredpage.html','popup!'); } catch(e) { alert('Unable to open another window!'); } } //--> </script>[/code]

Member Avatar for kavithakesav
0
242
Member Avatar for alfalisyada

You can try this demo: [code=javascript]<html> <head> <title></title> <script type="text/javascript"> <!-- function caculateFee(form) { if ( form ) { with ( form ) { var payamount = parseFloat( txtpayamount.value ); var courses = course.selectedIndex; txtbalfee.value = (((course.options[courses].value) * 1) - payamount); } } return false; } //--> </script> </head> <body> …

Member Avatar for danishbacker
0
2K
Member Avatar for raveeshlawrance

You can do it this way: [code=javascript]<html> <head> <title></title> <script type="text/javascript"> <!-- function createButton() { var div = ( document.all ) ? document.all['myDiv'] : document.getElementById('myDiv'); div.innerHTML = '<button id="btn" name="btn">Button</button>'; } //--> </script> </head> <body> <div id="myDiv" onclick="createButton();">Click Me!</div> </body> </html>[/code]

Member Avatar for raveeshlawrance
0
12K
Member Avatar for Ruizz

Try these: [code=html]<input type="text" id="txt1" name="txt1" size="20" value="" onchange="if (!/[A-Za-z\d]/.test(this.value)) alert('Invalid data!');" />[/code]

Member Avatar for essential
0
71
Member Avatar for tirso

This issue belongs to [b]PHP[/b] section. Am sure you'll get all what you need from there...

Member Avatar for sacarias40
0
116
Member Avatar for humipine

Im not sure if this is exactly what you need. But this will help you to get your things done. [code=javascript]<?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet 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 id="xhtml10" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://www.w3.org/2005/10/profile"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta http-equiv="Content-Language" content="en" /> …

Member Avatar for essential
0
231
Member Avatar for emilio

You may also try this demo: [code=javascript]<!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=utf-8"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <meta http-equiv="Content-Style-Type" content="text/css"> <title>Nesting Table with JavaScript</title> <style type="text/css" charset="utf-8"> <!-- table { border: 2px solid #800080; border-collapse: collapse; margin: 0 auto; min-height: 2em; width: 80% …

Member Avatar for serkan sendur
0
3K
Member Avatar for rajeesh_rsn
Member Avatar for jeffc418

Do it this way: [code=html]<html> <head> <title>Your title</title> </head> <body> <div> <form action="#" onsubmit="return false;"> <div> <label>Item 1 <input type="checkbox" id="ch0" name="ch0" value="" onclick="if (this.checked) document.getElementById('ch1').disabled=true; else document.getElementById('ch1').disabled = false;" /></label><br /> <label>Item 2 <input type="checkbox" id="ch1" name="ch1" value="" onclick="if (this.checked) document.getElementById('ch0').disabled=true; else document.getElementById('ch0').disabled = false;" /></label> </div> </form> </div> …

Member Avatar for essential
0
3K
Member Avatar for cguan_77

This will do it: [code=javascript]<script type="text/javascript"> <!-- function callMenu(n, isHidden) { document.all[(('menu')+n)].style.visibility = isHidden; } //--> </script>[/code]

Member Avatar for cguan_77
0
90
Member Avatar for santhanalakshmi

Try to create function that prevent's right click or some function to be trigger on unload event.

Member Avatar for serkan sendur
0
131
Member Avatar for rajeesh_rsn

Or you can also use RegExp to get precise handling with your form's. Here's a simple demo: [code=javascript]<html> <head> <title>Form field validation demo</title> <script type="text/javascript"> <!-- /* Field must contain atleast 6 characters long and must start with an alphabetic character(s) */ var userName = /^[A-Za-z\d]{6,12}$/; /* same with the …

Member Avatar for essential
0
91
Member Avatar for jumbla

Try this code... [code=javascript]<html> <head> <title>Some title</title> <script type="text/javascript"> <!-- function changeId() { var myform = (document.all) ? document.forms['boxsearchform'] : document.getElementById('boxsearchform'); var ids = myform.choosevar.selectedIndex; if ( myform ) { myform.iNPUT.id = myform.choosevar.options[ids].value; } else { document.getElementById('iNPUT').id = document.getElementById('choosevar').options[document.getElementById('choosevar').selectedIndex].value; } } //--> </script> </head> <body> <form action="search.php" method="post" id="boxsearchform"> <div> …

Member Avatar for essential
0
129
Member Avatar for millsy007

You can try this... [code=javascript]<!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"> <TITLE>Changin Date Format</TITLE> <SCRIPT TYPE="text/javascript"> <!-- var now = new Date(); var month = ((now.getMonth())+1); var dte = now.getDate(); var year = now.getFullYear(); month = ( month < 10 ? '0' …

Member Avatar for essential
0
106
Member Avatar for BimanD

Ok you wil need to create a flat file and name it as [b]myname.js[/b] then save it in the same directory along with your (x)html document. Here's the code for [b]myname.js[/b]: [code=javascript] function printMyName() { document.write('Your name!'); }[/code] Now incorporate it with your (x)HTML document: [code=html] <html> <head> <title>Your title</title> …

Member Avatar for serkan sendur
0
78
Member Avatar for rebsysue

Try this instead! If im goin to make some slideShow (or image swapping) this is what i usually do. Its up to you if you wanna try my demo. I've provided different titles for every image that will get to be swapped. [code=javascript]<html> <head> <title>Arrays and Putting title on your …

Member Avatar for cubekid
0
79
Member Avatar for alexgv14

You can try this one... [code=javascript]<html> <head> <title>Converting Arrays</title> <script type="text/javascript"> // var mygallery = { imagearray : [] }; /* This demo will inject new array's against your declared array's depending on the initial value, that you will need to provide in the ref arg. */ function convertToArrays( yourArray, …

Member Avatar for alexgv14
0
142
Member Avatar for Potato.Head

You will need to apply some CSS rules to justify all the element's in the center of your page, including the page that will be loaded on the iframe.

Member Avatar for essential
0
289
Member Avatar for xilovemusic123x

You can give all the restored variable (or values) in your textbox by simply doing this [code=javascript]document.forms[0].y.value = 'yourRestoredValue';[/code]

Member Avatar for nav33n
0
259
Member Avatar for vedmack

This can be done with css! [code=css]div, embed { margin: 0; padding: 0; } div { position: fixed; /* Now position your element(s) on the desired spot in your page. Try to use percentages when set you their values */ right: 1%; top: 1%; } div div { display: table; …

Member Avatar for vedmack
0
366
Member Avatar for fshaw

The first thing that you must do is give your form's a unique id(s) which you will be needing to call your form(s) in a javascript function's. [code=javascript]<html> <head> <title>demo</title><script type="text/javascript"> <!-- function submitForm() { if (document.all) { document.forms['myform'].submit(); } else { document.getElementById('myform').submit(); } } // which "myform" is the …

Member Avatar for essential
0
97
Member Avatar for theimben

Im not sure if this is what you need. But this trick wil work in some cases. Assuming that you have the following php function in your page [code=php]<html> <head> <title></title> <?php function changeBg() { $bgColour = $_REQUEST['demo']; if(!isset($bgColour)): echo $bgColour; else: echo '#fff'; endif; } echo '<style type="text/css">'; echo …

Member Avatar for essential
0
77
Member Avatar for klavier

From line [b]14[/b] and [b]19[/b] in your code. Simply register the two varibles like this: [code=javascript]// #14 firstinput = parseInt(firstinput.valueOf()).bold(); // #19 secondinput = parseInt(secondinput.valueOf()).bold();[/code]

Member Avatar for essential
0
126
Member Avatar for tulsi_apr03

In ff, Use the getElementById to call elements in your form, e.g. [icode]document.getElementById('yourform').formelement.value = 'yourValue';[/icode]

Member Avatar for tulsi_apr03
0
161
Member Avatar for hinasaeedali

Here's a simple demo, that will increment the value of n for 10 (or 10seconds) and then it will stop. [code=javascript]<!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=utf-8"> <title>DEMO</title> <script type="text/javascript"> function loadingSequence(counter) { var n= setTimeout('loadingSequence(1)',1000); x = 10; document.getElementById('d').value = ((n …

Member Avatar for essential
0
132
Member Avatar for arvindikchari

Hi there! You can provide the variable(s) you need with the use of a hidden field's. Let's assume that you have this hidden field in your document. [code=html]<input type ="hidden" name="colour" id="colour" value="" />[/code] now with your script on simply change line 8, with this [code=javascript]document.getElementById('colour').value = '#' + c[0];[/code] …

Member Avatar for essential
0
248
Member Avatar for eawade

Here's a simple demo, that you can work with. Hope it helps... [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 profile="http://www.w3.org/2005/10/profile"> <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>Manipulating Background color using textfield's</title> <style type="text/css"> /* …

Member Avatar for essential
0
260
Member Avatar for arvindikchari

This demo will only on work on IE6+, Opera7+ and ff3+ [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" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <style type="text/css" id="internal"> *{ } </style> <script type="text/javascript"> /* <![CDATA[ */ function demo() { …

Member Avatar for essential
0
144
Member Avatar for Ortal

Incorporate this event handler with your select element... [code=html]onfocus="javascript:try{loc=parseInt(prompt('Please enter a number not more than (your initial value).')); this.selectedIndex=(loc-1); window.open(this.options[this.selectedIndex].value,target='_blank','');}catch(e){alert('Some error(s)!')};"[/code]

Member Avatar for essential
0
92
Member Avatar for tkoehn5751

Try this [code=html]<a href="javascript:void(0);" onclick=" parent.frame1.location.href= 'http://www.biblegateway.com/passage/?book_id=' + document.myurl.book.value + '&chapter=' +document.myurl.chapter.value+'&version=9'; parent.frame2.location.href='http://www.biblegateway.com/passage/?book_id='+document.myurl.book.value+'&chapter='+document.myurl.chapter.value+'&version=8';">My Url</a>[/code]

Member Avatar for essential
0
78
Member Avatar for rajeesh_rsn

Ok, here's how we do it! Just bring this up in the header section of your page... This script will sniff out all your images and making it preloaded to your page -- you'll notice that your page loads a bit faster than the usual one... [code=javascript]<script type="text/javascript"> <!-- /* …

Member Avatar for almostbob
0
90
Member Avatar for windsdon

This will do it... I bring up some additional lines in your code... [code=javascript]/* A D D I T I O N A L B L O C K S ~ Do not try to alter anything beyond this block or this code will break */ var expiry = new …

Member Avatar for essential
0
80
Member Avatar for xerouk

Its really simple, converting textfield value and inserting it to your page. Ok il show how its done.

Member Avatar for essential
0
129
Member Avatar for ionnnnutz
Member Avatar for todo

Here's a little example on how to set high-lighted text with an onclick event! Just modify this according to your needs. [code=javascript]<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="#internal-style" 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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> …

Member Avatar for essential
0
2K
Member Avatar for theimben

This should do it! This demo will include the value of textbox in the action attribute and replace "VALUE" equals to the user inputed text-value. I've included some alert, so you can see (or check) if the value in action has been replaced by the inputed text. If you're done …

Member Avatar for essential
0
193
Member Avatar for blizeH

Simply add 1 with the [b]odays[/b] varible! [code]Math.floor(((((edate.getTime() - sdate.getTime()) / 1000 / 60 / 60 / 24) / 7) * 5) + (odays+1));[/code]

Member Avatar for essential
0
120
Member Avatar for zanzo

Wel am not sure if this wil work. First, try to add a [icode]<base>[/icode] module with your preferred (x)html document. [code=html]<base target="_top" />[/code] then try to incoporate the following bits of code in your script. [code=javascript]function someFunc() { //Storing location as array's and get the ref n#. var thisLocation = …

Member Avatar for gurshan
0
135
Member Avatar for joseywhales

Here and i hope this will help you in what you need... [code=javascript]<!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=UTF-8"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title>CrossBrowser Script</title> <script type="text/javascript"> <!-- var browser = { ua : function(myBrowser) { return navigator.userAgent.toLowerCase().indexOf(myBrowser); }, byName : function(myBrowser) { …

Member Avatar for essential
0
160
Member Avatar for mehdighobakhloo

Load this as your framed page, and be sure that you provide valid path and filename with your images or this will not work... [code=javascript]<?xml version="1.0" encoding="utf-8"?> <!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" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Random Images with frame</title> <base …

Member Avatar for mehdighobakhloo
0
85
Member Avatar for dinilkarun

[quote][code]{ SetAttribute( aCells[i], 'borderColor', GetE ('txtBorderColor').value ) ; SetAttribute( aCells[i], 'style', variable ) ; //not working } return true ; }[/code][/quote] it should be[b]setAttribute()[/b] not [color=red]SetAttribute()[/color]

Member Avatar for essential
0
85
Member Avatar for ayi_102

This will do it... [code=javascript]<script type="text/javascript"> function resetLists(){ document.forms[0].select1.selectedIndex = 0; document.forms[0].select2.selectedIndex = 0; } </script>[/code]

Member Avatar for ayi_102
0
296
Member Avatar for impactdesign

In this example -- the user will be alerted if the overAll value of the caculated field's is lower than 120. Ive used some of the fields' in your document and shorten things out! [code="javascript"]<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css" href="#internal-style" media="all"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html …

Member Avatar for essential
0
127
Member Avatar for rajeesh_rsn

Sorry Sid, if i post one this on, just got late and am just trying to help... [quote]All conditional statement can be extended with external or inline script --[/quote] [code=html]<textarea rows="5" cols="40" onkeyup="try{if(this.value.match(/\,/)){alert('This (,) character is not allowed on this field'); this.value='';}else if(this.value.length>=10){window.location.reload();}}catch(e){/* This is just a demo! */};"></textarea>[/code]

Member Avatar for almostbob
0
109
Member Avatar for Designer_101

Increase the dependability of your stylesheet by using percentage values referencing specific elements in [b](x)HTML[/b] document's instead of absolute width, height, margins and paddings, etc. And you have the following error in your stylesheet including your actual XHTML document, go and [url=http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.psychedelic-rhinos.co.uk%2Fimages%2Fstyle.css&profile=css21&usermedium=all&warning=1&lang=en]check it[/url]!

Member Avatar for MidiMagic
0
120
Member Avatar for ayi_102

Hi there! Heres the conclusion to your 1st query regarding changing the looks of your page. This script wil load specific themes' using different style sheets depending on the selection being provided by the user and of course with the help of cookies. It's a compact script, hope youll enjoy …

Member Avatar for ayi_102
0
188

The End.