518 Posted Topics

Member Avatar for fischb22

How do you trigger that effect? Here's another way to call element's in your page. [code]<html> <head> <title>test page</title> <script type="text/javascript"> <!-- var tm; window.onload = function() { try { alert( "tm: " + document.getElementsByTagName("span")["sector"].innerText ); } catch(e) { tm = ((document.getElementById ) ? document.getElementById("sector").innerText : document.all.sector.innerText ); alert("tm: " …

Member Avatar for essential
0
143
Member Avatar for prettynpinknc

You can still format the whole data input w/o leaving the page, unless you prefer doing this with cookie's or [b]PHP[/b]...

Member Avatar for essential
0
95
Member Avatar for starsinthesky

On your submit event simply apply this code: [code]<form method="post" action="adding_FAQ_check.php" name="fields" onsubmit="return checkFields(); /* without the [b]this[/b] global. */ ">[/code]

Member Avatar for starsinthesky
0
311
Member Avatar for chaituu

You can use this demo as a standard, when you are creating table element's. [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="X-UA-Compatible" content="IE=EmulateIE7"> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <TITLE>DEMO</TITLE> <SCRIPT type="text/javascript"> <!-- var createTable; createTable = function() { tableATT = document.createAttribute("style"); tableATT.nodeValue = "background-color : lightblue; …

Member Avatar for essential
0
97
Member Avatar for lonestar23

Try the following format: [b]aj.js[/b] [code=javascript]var paints, parameters, search7, colorIT; colorIT = function() { if ( search7.readyState === 4 ) { document.getElementById("textBack").value = search7.responseText; document.getElementById("divBack").style.backgroundColor = search7.responseText; } }; function getXmlHttpRequestObject() { search7 = null; paints = escape( document.getElementById("prints").value ); parameters = "paints=" + paints; if ( window.XMLHttpRequest ) { …

Member Avatar for essential
0
158
Member Avatar for Davife

Simply include all .js file's that you need in your document. Here's simple demo to clear things out: saying i have 3 .js files: [b]three.js[/b] [code=javascript]var varThree = varTwo; // varThree variable is not accessible to two.js and one.js // But varThree can access variables from the two other .js[/code] …

Member Avatar for Davife
0
122
Member Avatar for dreamygirl

Did you mean, collecting all the entries from the parent window and then passing those datas in the pop-up window? Am i getting it right? Or you just want to open a multiple window depending on the selected option?

Member Avatar for essential
0
183
Member Avatar for Syakoban

1st You can start with this little example. So that you'll easily get how everything works! [code]<html> <head> <title>your title</title> </head> <body> <form> <label>squareFeet: <input type="text" value="" id="sqft" name="sqft" size="6"></label><br> <label>thickness: <input type="text" value="" id="t" name="t" size="6"></label><br> <label>total: <input type="text" value="" id="total" name="total" size="10"></label><br> <button onclick="document.getElementById('total').value = parseInt((( parseInt( document.getElementById('sqft').value …

Member Avatar for Syakoban
0
238
Member Avatar for spazz

Inside the function reference (or the function that handle's the response). try to call your stated function passed by the [b]PHP[/b] script. [code=javascript]function processReq() { // Handling some renponse --> // Assuming that all reponses is handled and done callmyFunctionPassedByThePHP(); }[/code] If this will not work, then try to separate …

Member Avatar for essential
0
113
Member Avatar for tserva

You may appy the following codes in your document(s). And it seems that you are working with Firefox here, so this code will only work if you are using any version of ff browser's--the rest will be ignored. [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 …

Member Avatar for tserva
0
6K
Member Avatar for aashishn86

What's been bothering you about this script? If you were just asking about this [icode]if ( txt.match( idx ) ) { // so...on...[/icode] block--wel it simply say's [quote]that If the [color=red]value[/color] of selected option matched (or equal) the id of any defined element, then set the [icode]style.display[/icode] of this element …

Member Avatar for essential
0
140
Member Avatar for aashishn86

You can use the code provided by [b]mail2saion[/b] to validate your field. And you can try this basic example to change the names in your field's: [code]<form name="frm"> <div> <label>Default Text <input type="radio" value="" onclick="( this.parentNode.childNodes[0].nodeValue = ( !frm.elements[1].checked ) ? 'Mandatory' : 'Optional' ); frm.elements[1].parentNode.childNodes[0].nodeValue = 'Optional';"></label> <label>Default Text …

Member Avatar for aashishn86
0
101
Member Avatar for tamil.munusamy

Why do this, when you can simply call the script via src? Anyway here's a little example that wil load .js files via AJAX request. let's say you have this [color=red]my.js[/color] file that contains a few lines of: [code]function test() { return alert("I'm a function generated by an AJAX call!"); …

Member Avatar for tamil.munusamy
0
94
Member Avatar for servis

This can be achieved if you prefer using AJAX in your page. To get the basic of it, here's a simple demo for you. This example comes in 2 separated html document: the [b]main.html[/b] which holds the entire script, and the [b]request.html[/b] that holds another options and will be injected …

Member Avatar for servis
0
201
Member Avatar for rajeesh_rsn

To ensure the flexibility of your request in Gecko (Firefox) based browser's, you can simply add an extra method of: [code=javascript]// Assuming that everything is declared var requestObject = new XMLHttpRequest(); requestObject.overrideMimeType("text/xml"); // A method that overrides, header sent by the server, just incase it's not text/xml. // The rest …

Member Avatar for essential
0
151
Member Avatar for HelenLF

Here's a simple demo, to get you started. [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="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>JavaScript Demo</title> <script type="text/javascript"> // <![CDATA[ // Declaring variable …

Member Avatar for HelenLF
0
112
Member Avatar for sandeep_more97

Try this code, just be sure that you'll provide two valid URL, along with the action attribute of the two forms. [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="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> …

Member Avatar for essential
0
4K
Member Avatar for knrakesh

This demo will alert the user, depending on which is field is empty. Lets say for example, ( if field 1 is empty then, field 1 will be identified as invalid entry and as well as with the other field's also). Don't worry--If you need a simple demo, im sure …

Member Avatar for essential
0
144
Member Avatar for Lleoun

Since i cannot run any test using [b]PHP[/b], i'll just provide you a basic demo using [icode]XMLHttpRequest()[/icode] object, to deal with the current issue. [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="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta …

Member Avatar for essential
0
857
Member Avatar for bigtalk

The simplest way to do this, is to fake it by their ids. In this demo i used the individual id of the anchor element's, making it as my pointer to get specific div's on the page. Code is as follows: [code=javascript]<?xml version="1.0" encoding="utf-8"?> <?xml-stylesheet type="text/css href="#internal"?> <!DOCTYPE html PUBLIC …

Member Avatar for Airshow
0
216
Member Avatar for joeltonnberg

You can try this one: [code=javascript]<html> <head> <title>DEMO</title> <script type="text/javascript"> <!-- var pageRequest, isContent; var jumpMenu = function() { var loadPage = function() { isContent = pageRequest.responseText; // Requested data should be in a form of ( rensponseXML ). to get specific element's from the requested page. /* if ( …

Member Avatar for essential
0
121
Member Avatar for tarview

([b]home.php[/b]) with your [icode]subscribe()[/icode] function, in line#4. You forgot to specify the properties of the two following objects, (which is--> name &amp; email): [code]// It should be --> var url = "subscribe.php?name=" + escape(document.frmSubscribe.name.value) + "&amp;email=" + (document.frmSubscribe.email.value);[/code] hope it claim's the current issue, and good day to you...

Member Avatar for tarview
0
125
Member Avatar for servis

Hope this will help... [code=javascript]<html> <head> <title>DEMO</title> <script type="text/javascript"> <!-- function validate( form ) { try { with( form ) { if ( !agreement.checked ) { alert ("Please commit the agreement to continue."); agreement.focus(); return false; } if (( conPerP1.value == "" ) || ( conPerP2.value == "" )) { …

Member Avatar for servis
0
294
Member Avatar for thenamenoonehas

This demo will allow you to populate the current field with a lists of options from another page. You can also switch back from the previous page and gain the default list (vise versa). Here's the code for the [b]test.html[/b] which is currently set as the default list, on the …

Member Avatar for essential
0
105
Member Avatar for Dabeam

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="X-UA-Compatible" content="IE=EmulateIE7"> <title>JavaScript DEMO ( For loop with icremented characters )</title> <script type="text/javascript"> <!-- var show, ar, x, num = 1; function display() { ar = "***********"; for ( x = …

Member Avatar for Airshow
0
93
Member Avatar for gagan22

Do it this way: [code=javascript]<html> <head> <title></title> <script type="text/javascript"> <!-- function validate( form ) { if ( !confirm("Are you sure to delete these details from database?") ) { return false; } else { return true; } } // --> </script> </head> <body> <form action="process.php" method="post" id="form1" onsubmit="return validate( this );"> …

Member Avatar for mail2saion
0
148
Member Avatar for nanna

You try this code: [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="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Language" content="en-us" /> <title>Bear Toys</title> <style type="text/css"> html, body, div, img, table, …

Member Avatar for essential
0
126
Member Avatar for nrsbr

I'l just provide what it needs and the rest should go to you. [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="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>Online Store</title> <style type="text/css"> …

Member Avatar for essential
0
335
Member Avatar for kurraboy

Im not sure if this is what you need! But both condition can be achieved with a [b]try...catch[/b] block. [code=javascript]<html> <head> <title>DEMO</title> <script type="text/javascript"> <!-- var xmlDoc; var setupPage = function() { var x, y, z; try { // lead_recepient x = xmlDoc.getElementsByTagName("lead_recipient")[0].childNodes[0].nodeValue; y = replaceChars( x ); // Am …

Member Avatar for essential
0
136
Member Avatar for mansterdom

Your script is ok! Try to apply the following format and see how it works: [code=php]<?php echo '<script type="text/javascript">'; include 'workout.php'; echo 'var numrecords = '.$numrows.';'; print "var muscle = [];\n var exercise = [];\n </script>"; // so on... ?>[/code]

Member Avatar for essential
0
103
Member Avatar for h2onet

From the [icode]show2()[/icode] function, on the first line of [icode]if ( )[/icode] statement — simply change the condition into this: [code]if ( document.form1.state.selectedIndex == 1 ) { // No need to edit all codes that follows[/code]

Member Avatar for h2onet
0
108
Member Avatar for millsy007

You can achieved that result by doing this: [code=html]<a class="home" href="javascript:void(0);" id="home" onclick="this.className='current';">home</a>[/code]

Member Avatar for essential
0
163
Member Avatar for jonpb

This is a long lost issue, but let me provide you a simple demo on how to deal with this thing. Just be careful when you are editing the line's or the whole script will be worthless. [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" …

Member Avatar for essential
0
284
Member Avatar for EJM

The [icode]delete_cookie()[/icode] function is messing up the program. Try doing this: [code=javascript]function delete_cookie(name) { var exp = new Date(); var expdate = exp.setTime( exp.getTime() - 1 ); document.cookie = name + "=; expires=" + expdate + "; path=/"; }[/code]

Member Avatar for essential
0
84
Member Avatar for praveen_dusari

You can do this by creating hidden div's on an absolute position with the help of CSS+javascript. If something fails, then show them the specified div of your choice, containing your (x-!-?) images and your warning messages.

Member Avatar for praveen_dusari
0
64
Member Avatar for Designer_101

From the [icode]makevisible()[/icode] function, add this:[icode][b][color=red]stop[/color][/b] = setTimeout("minimize()", 4000);[/icode]. Then in the [icode]minimize()[/icode] function add this [icode]clearTimeout([b][color=red]stop[/color][/b]);[/icode] as the first statement &#8212; the rest of your code is as follows.

Member Avatar for Designer_101
0
114
Member Avatar for newboi

Ok, let's say you have this forms on this id's (form0, form1). Now apply the code that will do a multiple [icode]submit()[/icode] on those forms, like this: [code=javascript]<script type="text/javascript"> <!-- Must go on the header section of your page. Function submitTwoForms() { for ( var x = 0; x < …

Member Avatar for ~s.o.s~
0
145
Member Avatar for danielpataki

Apply another statement that will trap different settings for different types of browsers! e.g [code]if ( document.all ) { esw = e.scrollWidth; esh = e.scrollHeight; // Which holds for IE Mode } else if ( document.getElementById ) { esw = e.scrollX esh = e.scrollY } // Which is supported by …

Member Avatar for essential
0
90
Member Avatar for konczuras

Do it this way: [code=javascript]<script type="text/javascript"> var sfEls; var sfHover = function() { sfEls = document.getElementById("btn"); sfEls.onmouseover = function() { this.className += "sfhover"; }; sfEls.onmouseout = function() { // simply assign the class again, instead of replacing it. this.className = "someClass" }; }; if (window.addEventListener) window.addEventListener("load",sfHover,false); else if (window.attachEvent) window.attachEvent("onload",sfHover); …

Member Avatar for konczuras
0
166
Member Avatar for Theeba

You can do it with CSS and a few lines of javascript: Let's say you have this classes in CSS rules. [code=css]form { min-height : 300px; margin : 0 auto; width : 95%; } /* which stated on the current form position */ form.move-to-bottom { position : absolute; bottom : …

Member Avatar for essential
0
71
Member Avatar for inartistic

Here's something that you can work with, tested in ie6+ and opera9. This is the code for the (x)HTML document, all codes is as follows: [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="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> …

Member Avatar for essential
0
123
Member Avatar for bimaljr

Reg pattern(s) in literal forms should not be quoted: [code]// Instead of --> myRegExp = "/index.php\?\//"; // Simply change this to --> myRegExp = /index\.php\?\//;[/code]

Member Avatar for essential
0
164
Member Avatar for Arumugams

I've done a Lite modification in your code, the getHTTPObject() function has been removed on. [code=javascript]var httpObject, url; function setOutput() { if ( httpObject.readyState == 4 ) { document.getElementById("outputTex").value = httpObject.responseText; } else { alert("Failed to load data " + httpObject.statusText); } } function doWork() { url = "http://10.10.2.46:4001/upperCase.php?inputText" + …

Member Avatar for essential
0
122
Member Avatar for bamboebahr

This will help you out and get your things done in no time! Try these [url=https://developer.mozilla.org/en/AJAX/Getting_Started]L I N K[/url]!

Member Avatar for bamboebahr
0
100
Member Avatar for veledrom

Use the eventListener, instead of assigning it directly on those tags that you have mentioned. The only elements that will validates with those events, are the &#8212; [icode]<!-- <a> <img .../> <form><elements></form> <area> -->[/icode]. And be sure to use only elements that is valid in the DOCTYPE that you are …

Member Avatar for essential
0
168
Member Avatar for JooClops

The problem is on line #37 and #38: [code=javascript]//undefined object - // it should be theform.pass.focus() instead of: form.pass.focus(); // theform.pass.select() instead of: form.pass.select();[/code]

Member Avatar for JooClops
0
156
Member Avatar for lolodede

Try this demo: [code=javascript]<html> <head> <title></title> <script type="text/javascript"> <!-- var number = new RegExp(/[0-9]{1,2}/) || /[0-9]{1,2}/; // This will prevent the user from entering non-numeric values on the field - // and this will also validates on two digits values, so it can only be from 0-99 function checkNum( form …

Member Avatar for essential
0
95
Member Avatar for lifeworks

Try this on the first anchor that trigger's your script: [code=html]<a href="javascript:void(0);" onclick="showHide('div_id'); return true;">[/code] if this doesnt work, then try to post the actual script so others can help you.

Member Avatar for essential
0
69
Member Avatar for lalapengi

For this issue, both is applicable! But if you want to get optimum performance in your JavaScript program's, then you should try [url=http://www.jslint.com/]THIS LINK[/url].

Member Avatar for ~s.o.s~
0
87
Member Avatar for joeltonnberg

You can perform loop on the specified element's, like this: [code=javascript]function pageLoad() { var elem = document.getElementsByTagName("div"); // any reference that you can provide for ( var x = 0; x < elem.length; x++ ) { collapseAll($('myvar_'+x)); } }[/code]

Member Avatar for essential
0
101

The End.