518 Posted Topics
Re: Hi, here's a simple demo that will help you to accomplish your task. this demo comes with 2 documents: [b]test.php[/b] [code]<?php echo '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w3.org/TR/xhtm1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="EmulateIE6" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Cache-Control" content="no-cache" … | |
Re: Hi, you could also try this: [CODE]<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!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-US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Conent-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>www.daniweb.com [ JS character counter to 'double' certain characters? ]</title> <script type="text/javascript"> // <![CDATA[ var … | |
Re: Hi, [B]AJAX[/B] is not necessary for this type operation, here's a simple code that demonstrate on you perform such task: [CODE]<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!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-US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Conent-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>JavaScript … | |
Re: Here's a simple demo to help you get, things done. This is tested in ie5+, ff3+ and Op8+. Here's the code for the main page: [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" … | |
Re: Hi, here's a short bit of example on how you would be able to clear those field values: [CODE]<html> <head> <title>Live Help</title> <script type="text/javascript"> <!-- var clearFields = function() { var form = document.getElementById("registerForm") || document.forms.registerForm; var elem = { 0 : "First_name", 1 : "Last_name", 2 : "Username", 3 … | |
Re: Hi servis, you could try this [url=http://www.daniweb.com/forums/thread259141.html][B]thread[/B][/url] and see how I made an [B]AJAX[/B] call via the onsubmit handler. hope it helps you... | |
Re: This should work! Instead of ( [b]readAttribute[/b] ) / simply replace it with the ( [color=red]getAttribute[/color] ). [code]window.location.hash = $(Event.element(e)).[color=red]getAttribute[/color]('href'); new Ajax.Updater('main', $(Event.element(e)).[color=red]getAttribute[/color]('href'), {method: 'post' }[/code] | |
Re: From the [b]showQuotation()[/b] function, replace it with the following format: [code]function showQuotation() { document.write( "<b>" + Quotation[whichQuotation] + "</b>" ); }[/code] | |
Re: Try this code: [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>Populating text field</title> <script type="text/javascript"> <!-- function textFill(ref, data) { var ua = (document.all) ? document.all[ref] : document.layers[ref]; try { if ( ua ) { ua.value = data; } … | |
Re: Hi, you can try this: [code]<!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>www.daniweb.com</title> </head> <body> <noscript> <p> This site requires a browser that support <b>JavaScript</b>. </p> </noscript> <div id="div0"> <script type="text/javascript"> <!-- ( function() { var applet = "applet" … | |
Re: Hi, obtaining [b]Airshow[/b]'s suggestion of the DOM procedure over the document and also i've applied some iframes to simulate real window experience: [code]<!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>www.daniweb.com</title> <style type="text/css"> <!-- body { min-height : 600px; } … | |
This script will lists all available methods, properties, values, and types, supported inside your browser. This is useful when you are creating script and you want to see a full reference lists of methods supported on the browser that you are working on - then you can simply run the … | |
A simple tool that provides easy navigation in your site using a Combo box. It lets you jump to different location on the Web and also included with text display, which provides short details about the site. If you have comments, suggestions or request — don't hesitate to post back … | |
This script simply preload's images inside (x)HTML document. [b]<<<INSTRUCTION>>>[/b] — Simply attached these preloader.js in your document, were you want your images to be preloaded. — You can simply referenced it using [icode]<script type="text/javascript" src="path/preloader.js"></script>[/icode] block. — if you have any suggestions, comments or request, please feel free to post … | |
This script is capable of handling multiple iframes inside your page. Which allow you to specify [b]fixed[/b] [color=red]Width[/color]/[color=red]Height[/color] with your iframes' to ensure layout stability in your page and also it comes with an auto-fit feature. [b]<<<INSTRUCTION>>>[/b] — [color=green]The[/color] iframeFixer.js [color=green]must be included in your[/color] iframe page [color=green]including all pages … | |
This version is more precise and accurate compared to my first posted version of this script. | |
In for the latest addition to my code snippets, here's one you'll trully appreciate. This validation tools is packed with the W3Cs (x)HTML Markup validator, CSS validator, MobileOK tester and Semantics Extractor. hope you'll enjoy this newest addition of snippets'... | |
A two columned fixed layout with vertical navigation sample. Now all it needs is your great imagination. Hope you find this useful, and help you all the way in your web activities. Enjoy... | |
A basic example on how to change your stylesheet dynamicaly! I will use a dropDown list to control the environtment! Assuming that you have 4 different .css ( default, red, blue and green ) on your directory! From this line you'll have to replace this with your own stylesheets. [b]default.css[/b] … | |
A simple date picker with live 12/24hr clock, month/week names, 2/4 digits' year display and supported with configuration settings... | |
Making a calendar is a bit more complex than making a timer or clock but mostly because any calendar script is going to be generating HTML to display the calendar and whenever you have programs writing programs things always get a bit funky! We'll do this as a prototype so … | |
[color=maroon]This method escapes all &, <, and > symbols in the string, making it safe to display the string on a web page without fear that it will be treated as HTML.[/color] | |
Re: Hi, here's a simple demonstration of installing events onto target elements': [code]<!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>Adding Events</title> <script type="text/javascript"> <!-- var addEvent = Object.prototype.addEvent = ( function( eve, fun ) { if ( "addEventListener" in window … | |
Re: Hi, try the following pattern below, to strip down element in the page if the [icode]getElementById[/icode] method, fails to catch your target object. [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>Free Live Help!</title> <script type="text/javascript"> <!-- var checkObj = … | |
Re: Hi, try this for now: [code=javascript]<script type="text/javascript"> <!-- function notEmpty() { var _form = ( "form" in document ) ? form : document.getElementById("form"); if ( _form.eponimo.value ) { return true; } alert( "field cannot be empty!" ); _form.eponimo.focus(); return false; } //--> </script>[/code] | |
Re: Hi Lev, i've made a lite modification inside your function and preserved all of your implemented lines: [code]<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml-stylesheet type="text/css" href="./scripts/imt.css" media="all"?> <!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" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" … | |
![]() | Re: Hi, here' a simple document that uses [b]HTML DOM[/b] manipulation procedure: [code]<!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-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title>http://www.daniweb.com</title> <style type="text/css" media="screen"> <!-- table { width : 100%; color : #778899; letter-spacing : 2px; background-color : … ![]() |
Re: Hi, try to re-apply few changes over lines': [code]<script type="text/javascript"> // <![CDATA[ function generate() { var sms = '' var impact = document.sms.impacted.value; var status = document.sms.status.value; var action = document.sms.action.value; var [color=red]BR = '\n'[/color]; sms = sms + '<textarea name="template" rows="10" cols="55">'; sms = sms + 'Service Impacted: '+ … | |
Re: Hi kintaro, try this code: [code=javascript]<script type="text/javascript"> // <![CDATA[ var d = document; var GetXmlHttpObject = 0; if ( d.getElementById ) { ( GetXmlHttpObject = function( ) { var req = 0; if ( req = new XMLHttpRequest() ) { return req; } try { var client = [ "MSXML2.XMLHTTP.5.0", … | |
Re: Hi Eduardo, try to make it in a lowercase format when you specify its tagname: [icode]var x = document.getElementsByTagName("[color=red]div[/color]")[/icode]. Havnt tried your code yet. Please let me know how it worked.. | |
Re: You could try this: [code]<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml-stylesheet type="text/css" href="#css21" media="screen"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html id="xhtml10S" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head profile="http://www.w3.org/2005/10/profile"> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="Window-target" content="_top" /> <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>Free Live … | |
Re: Hi rahul, you could also try this simple application: [code]<!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>Free Live Help!</title> </head> <body> <script type="text/javascript"> <!-- var emp = new Array( 5 ); for ( var i = 0; i < … ![]() | |
Re: Hi, try this instead: [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>www.daniweb.com</title> <script type="text/javascript"> <!-- var d = document; window.onload = function() { var els = ( "testform" in d ) ? d.testform : d.getElementById( "testform" ); var attr … | |
Re: Hi everyone, mbirame — you could also try this one: [code=javascript]<?xml version="1.0" encoding="utf-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html id="xhtml10" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- W3Cs Standard Template : XHTML 1.0 Transitional DTD --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>www.daniweb.com</title> <style type="text/css" … | |
Re: Hi, try this one: [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>www.daniweb.com</title> <script type="text/javascript"> <!-- var d = document; var validate = function( field ) { var today = new Date(); var field = ( typeof( field ) === … | |
Re: Hi jay, here's a simple demo that converts all checked items, into an array of length, using a single hidden field: [b]startpage[/b] [code=javascript]<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml-stylesheet type="text/css" href="#css_level21" media="screen"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> … | |
Re: Hi everyone, the first-child access will only work if you have no other nodes' next to the target element. So the safest way to get the 1st-element would be: [code=javascript]<?xml version="1.0" encoding="utf-8" standalone="no"?> <?xml-stylesheet type="text/css" href="#css21" media="screen"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html id="xhtml10S" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> … | |
Re: Hi DealthRune, you could try this: [code]<!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>Free Live Help!</title> <script type="text/javascript"> <!-- var _confirm = function() { if ( confirm("Are You Sure You Want To Logout?")) location.replace("logout.php"); }; // JavaScript-1.5 --> </script> … | |
Re: Hi peter and totaal, - totaal i am not sure if this will claim what you really need over your project, but i hope this will help you in some other ways. Here's the code: [code]<!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"> … | |
Re: Hi polo, do you have a ready document? Or you need if from the scratch? | |
Re: Hi, you can try this with your form: [code]<!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>www.daniweb.com</title> <script type="text/javascript"> <!-- window.onload = ( function( monthid ) { var monthid = ( monthid - 1 ); return function() { var ids … | |
Re: Hi UncleJoe, You can skip the long declaration of your arrays collection by using a single stance of: [code]var elements = []; // Starting with an empty array. for ( var i = 0; i < 400; i++ ) { // Looping procedure that counts up to 400xdivs ids. elements[ … | |
Re: Hi, under IE mode you must include a [icode]name="someName"[/icode] attribute along with your input elements'. Here's a quick demontration: [code]<!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-Style-Type" content="text/css"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <title>http://www.daniweb.com</title> <style type="text/css"> <!-- --> </style> <script type="text/javascript"> <!-- window.onload … | |
Re: Hi Xessa, try this table format: [code]<table frame="void" rules="none" border="0" width="100%" cellpadding="0" cellspacing="0"> <colgroup> <col style="width : 30%; vertical-align: middle; text-align : left; padding : .300em;"> <col style="width : auto; vertical-align: middle; text-align : center; padding : .300em;"> </colgroup> <tr><td>Helegemere:</td><td><input type="text" value="" size="30"></td></tr> <tr><td>More:</td><td><input type="text" value="" size="30"></td></tr> </table>[/code] | |
Re: Things can be handled in both ways, by implementing some lines along with the [icode]documen.forms[index][/icode] itself, enhancing its support for the other modes of browsers: [code]var form = (( document.getElementById ) ? document.getElementById( "yourFormId" ) : document.forms["yourFormId"] ); // more stuff >>>[/code] that should work in both browsers. | |
Re: Hi cheeki, here's a simple demo, showing a different way of calling your ajax request and how to set your own timer and make auto updates in your elements. And also i've revealed some of the lines behind, the used of prototype.js ajax handler, this will give you a small … | |
Re: Hi rapture, All things can be simulated under the used of a client-side-scripting, like [b]JavaScript[/b]. But not as efficient of what [b]PHP[/b] can offer. And also if you will pick javascript for this job, then this will require some tedeous work over the lines' and alot testing's for the whole … | |
Re: Hi polo, im not sure, if this is what you intend to do, but this might help you out, to shorten the lines inside your code and as wel as making the code to work in other modes of browsers. [code]<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml-stylesheet type="text/css" href="#css_level21" media="all"?> <!DOCTYPE html … | |
Re: Hi, try this first: [code=javascript]<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml: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>http://www.daniweb.com :: DHTML JavaScript / AJAX</title> <script type="text/javascript"> // <![CDATA[ var ChangeCol = function() … | |
Re: Hi aosmith, your code looks fine to me and maybe what it needs is a little adjustment. Please don't get confused by the lines that i have implemented on this demo, my intention is to provide better support in AJAX handling, no matter what version of browsers that may come … |
The End.