518 Posted Topics
Re: 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 … | |
Re: 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, … | |
Re: 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 … | |
Re: 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] | |
Re: 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] | |
Re: 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> … | |
Re: 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] | |
Re: 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] | |
Re: This issue belongs to [b]PHP[/b] section. Am sure you'll get all what you need from there... | |
Re: 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" /> … | |
Re: 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% … | |
Re: 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> … | |
Re: This will do it: [code=javascript]<script type="text/javascript"> <!-- function callMenu(n, isHidden) { document.all[(('menu')+n)].style.visibility = isHidden; } //--> </script>[/code] | |
Re: Try to create function that prevent's right click or some function to be trigger on unload event. | |
Re: 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 … | |
Re: 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> … | |
Re: 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' … | |
Re: 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> … | |
Re: 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 … | |
Re: 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, … | |
Re: 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. | |
Re: 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] | |
Re: 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; … | |
Re: 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 … | |
Re: 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 … | |
Re: 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] | |
Re: In ff, Use the getElementById to call elements in your form, e.g. [icode]document.getElementById('yourform').formelement.value = 'yourValue';[/icode] | |
Re: 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 … | |
Re: 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] … | |
Re: 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"> /* … | |
Re: 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() { … | |
Re: 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] | |
Re: 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] | |
Re: 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"> <!-- /* … | |
Re: 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 … | |
Re: Its really simple, converting textfield value and inserting it to your page. Ok il show how its done. | |
Re: 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" /> … | |
Re: 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 … | |
Re: 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] | |
Re: 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 = … | |
Re: 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) { … | |
Re: 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 … | |
Re: [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] | |
Re: 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] | |
Re: 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 … | |
Re: 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] | |
Re: 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]! | |
Re: 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 … |
The End.