1,330 Posted Topics

Member Avatar for Violet_82

Hi Violet, There's no point driving yourself nuts writing something like this. Slideshows is one area that is seriously well supported with jQuery plugins, most of which would do the job far better than you or I could ever achieve in a reasonable timescale. I just googled "jquery slideshow plugin" …

Member Avatar for Violet_82
0
371
Member Avatar for Waynef

Wayne, This would make better use of jQuery, and may also fix the problem: [CODE] function openimage(a) { var b = jQuery('#photo' + a); var c = jQuery('#album' + a); var d = jQuery('#clicks' + a); if(d.val() == '1') { // == not = jQuery.facebox({ ajax: 'profile/previewphoto.inc.php?photo=' + b.val() + …

Member Avatar for Waynef
0
130
Member Avatar for kukuruku

You are in the wrong forum but ... ... it may be to do with how you are using [iCODE]isset()[/iCODE]. Try: [CODE=php] $city = isset($_GET['city']) ? $_GET['city'] : ''; $state = isset($_GET['state']) ? $_GET['state'] : ''; ... $xslt->setParameter(NULL, 'city', $city);//unconditionally $xslt->setParameter(NULL, 'state', $state);//unconditionally ... [/CODE] [B]Airshow[/B]

Member Avatar for Airshow
0
129
Member Avatar for BlueCharge

BlueCharge, Remember that vars in javascript functions are global unless localised with [iCODE]var[/iCODE]. [CODE] var itemTimeLeft<?=$itemID;?> = new Date(...); ... var amount = ddate - new Date(); ... var ended = document.getElementById(iid); ... var days, hours, mins, secs, out=""; ... etc. [/CODE] [B]Airshow[/B]

Member Avatar for Airshow
0
204
Member Avatar for Hani1991

Nope, you can't force browsers' javascript to ON. [iCODE]<!-- code -->[/iCODE] is used to hide javascript from very old browsers which didn't support javascript at all. Otherwise they would render the script as text. Today, we really don't need to use [iCODE]<!-- code -->[/iCODE]. I never use it. [B]Airshow[/B]

Member Avatar for Pro2000
0
107
Member Avatar for Ritesh_4

[url]http://plugins.jquery.com/plugin-tags/flipbook[/url] [url]http://codecanyon.net/item/flipbook-jquery-powered-w-media-gallery/152110?ref=jtop&clickthrough_id=28064005&redirect_back=true[/url]

Member Avatar for Ritesh_4
0
146
Member Avatar for iamthwee
Member Avatar for aleenkhan

There's nothing to stop you having two or more script tags lined up on the page like that. I have seen pages with ten or more. You typically have to ensure that scripts are loaded in the right order. For example, there's no point loading a script that uses mootools …

Member Avatar for Airshow
0
89
Member Avatar for Dragonbaki

Dragonbaki, I've not needed to do this but here are my thoughts ..... The most efficient way would be to make what's called a "HEAD request" and the easiest way I can find to do this is a jQuery plugin: [url]http://plugins.jquery.com/project/jqHead[/url] As written, I'm pretty certain this plugin won't handle …

Member Avatar for Airshow
0
1K
Member Avatar for blotind

Bloto, Check out your js error console. Line 70, "echo" is not a js command. [B]Airshow[/B]

Member Avatar for Airshow
0
181
Member Avatar for siabenie

Siabenie, You appear to have the necessary coding skills but just need clarification on how to make the form validation process hang together. I will therefore attempt to talk you through it without offering any code. The model that you appear to need (and is typical) is one in which …

Member Avatar for siabenie
0
883
Member Avatar for azegurb

Aze, From what I can see, [I]Enter[/I] doesn't have the required action because the ajax handler is attached to the submit button ("search_button"). [I]Enter[/I] will not trigger this button's event unless the button has focus. However, [I]Enter[/I] will trigger the [B]form's submit event[/B] when various form elements have focus, importantly …

Member Avatar for Airshow
0
106
Member Avatar for come_again

Make sure the form and the input field both have unique names (typically identical to their ids) then try [iCODE]document.forms["formname"].elementName.value[/iCODE]. [B]Airshow[/B]

Member Avatar for Airshow
0
216
Member Avatar for AngelicOne

AngelicOne, Choices choices .... One way to do this is to stack your error messages up in an array, then dump the joined array to eg. an "error" div. Here is is in pseudocode: [CODE] function validate() { var errorMsg = []; if (test_1) { errorMsg.push(errorMessage_1); } if (test_2) { …

Member Avatar for AngelicOne
0
248
Member Avatar for ErangaD

[QUOTE=ErangaD;1613318] I tried a round with PHP and Javascrpits but could not find a solution [code=JavaScript] document.getElementById("RunNo").disabled = true; document.forms["EditRun"]["RunningNo"].disabled="true"; document.getElementById("RunNo").readOnly="readonly"; document.getElementById("RunNo").setAttribute("readonly", "true"); document.getElementById('RunNo').readOnly=true;[/code] [/QUOTE] The first two look fine, but use [ICODE]true[/ICODE] rather than [ICODE]"true"[/ICODE]. [code=JavaScript] document.getElementById("RunNo").disabled = true; document.forms["EditRun"]["RunningNo"].disabled = true; [/code] [QUOTE=ErangaD;1613318] ... but when the text …

Member Avatar for Airshow
0
177
Member Avatar for petrakid

Petrakid, There are various ways to do this. Here's one: [CODE] <!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> <style> </style> <script type='text/javascript'> function GetXmlHttpObject() { var xmlHttp = null; try { // Firefox, Opera 8.0+, Safari xmlHttp=new XMLHttpRequest(); } catch (e) { //Internet Explorer try { …

Member Avatar for petrakid
0
1K
Member Avatar for cjohnweb

cjw, Looking only at your second post, I can't see anything obviously wrong with the php/jquery as long as it's wrapped in script tags and an appropriate jQuery structure: [CODE=javascript] $(document).ready(function(){...}); //or $(function(){...}) [/CODE] A couple of further provisos: [LIST=1] [*][ICODE]if($('#plantname').length > 0)[/ICODE] checks for the existence of the id="plantname" …

Member Avatar for Airshow
0
219
Member Avatar for emmas4impact

Emmas4, Thinking macroscopically, you need first to devise a development strategy. I suggest you proceed as follows: [LIST=1] [*]Hand-code an initial XML file. [*]Develop client-side interpretation of the XML (ie. javascript/Google Maps). Adjust XML file as required, as your ideas develop. [*]Work up database structure to accommodate all the data …

Member Avatar for emmas4impact
0
975
Member Avatar for uniquedevil65
Member Avatar for sha11e

Sha11e, You are trying to do something called "cross-domain ajax", which violates all the latest browsers' security models (why? is another question). IE5 and IE6 were OK with this, but nothing before or since. Try googling "cross-domain ajax" for some good discussions and solutions. Personally, I like the [URL="http://flxhr.flensed.com/"]flXHR[/URL] by …

Member Avatar for Airshow
0
93
Member Avatar for Joemeister

Joemeister, Here's a big clue: [CODE] <form ..... onsubmit="[COLOR="red"]return[/COLOR] checkdate(this.php_date); [COLOR="red"]return[/COLOR] validateForm();> [/CODE] validateForm will not execute regardless of whether checkdate returns true or false. [B]Airshow[/B]

Member Avatar for Airshow
0
582
Member Avatar for faizurrahman

I understand cultural significance of Hijri but its use on the web will be misleading to many. However you clearly have a particular audience in mind so please read on. If you find a solution, then ensure the calendar is annotated to indicate that is is Hijri - unless that …

Member Avatar for Airshow
0
1K
Member Avatar for rajeesh_rsn

This will preload all the images, so they will stand a reasonable chance of being in browser cache when user clicks each thumbnail: [CODE] ... var img, mainImg = jQuery('#mainImg').get(0); jQuery('products li img').each(function(){//loop to preload images immediately img = new Image(); img.src = this.href; }).click(function(){//establish onclick handler mainImg.src = this.href; …

Member Avatar for Airshow
0
58
Member Avatar for raghujosh

raghujosh, Finger trouble .... [CODE=javascript] // document.getElementBy('lat').value= results[0].geometry.location.lat(); document.getElementById('lat').value= results[0].geometry.location.lat(); // document.getElementBy('long').value= results[0].geometry.location.lat(); document.getElementById('long').value= results[0].geometry.location.lat(); [/CODE] [B]Airshow[/B]

Member Avatar for Airshow
0
5K
Member Avatar for san-biegwenja

San-biegwenja, To access the hostname of the current page, [iCODE]location.hostname[/iCODE]. You can similarly access the hostname of other urls, eg the href of a hyperlink, [iCODE]document.getElementById("mylink").href.hostname[/iCODE]. This utility may be of interest: [url]http://www.daniweb.com/web-development/javascript-dhtml-ajax/code/217388[/url] [B]Airshow[/B]

Member Avatar for Airshow
0
38
Member Avatar for devinodaniel

Devinodaniel, I haven't got time to post code but the principle you need is to work [U]relative[/U] to the select element when its onchange event fires. To achieve that, pass [iCODE]this[/iCODE] rather than [iCODE]this.value[/iCODE] to the onchange handler. You can then read the value inside the handler. Use .parentNode().parentNode() etc, …

Member Avatar for Airshow
0
234
Member Avatar for vizz

Vizz, You have to move an element in order to get it to bounce. Below, the principle is illustrated with "swing" (because I'm too lazy to install jQueryUI): [CODE] <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Modal Window</title> <style type="text/css"> #mask { …

Member Avatar for vizz
0
203
Member Avatar for devinodaniel

Food for thought ... here's a completely different approach: [CODE] <!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> <style> </style> <script type='text/javascript'> onload = function(){ var macFields = document.getElementById("macFields"); var mac_ = macFields.getElementsByTagName("input"); function writeMacToHidden(){ var m = []; for(var i=0; i<mac_.length; i++){ m.push(mac_[i].value); } document.forms[0].mac.value = …

Member Avatar for Airshow
0
5K
Member Avatar for ghosh22

Why not do both stages on one page? Initialise with only those form fields showing that are initially relevant. Make the first submission "faux"; hide/show form fields and controls as required. If necessary perform some ajax at this point to get further data / perform checks etc. server-side. Make the …

Member Avatar for ghosh22
0
228
Member Avatar for rinjin07

Rinjin, Here's a few things to try: Give the page a doctype (first line, right at the top of the file). eg. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Install google maps on the page: <script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> If it still doesn't work, then split the code down the …

Member Avatar for rinjin07
0
484
Member Avatar for choboja621

Maybe academic but ... I think that some browsers' security (subject to settings?) will not play ball with absolute URLs of protocol "file:". The reason I am uncertain is because I never do this. Solution: use relative URLs. [B]Airshow[/B]

Member Avatar for Airshow
0
134
Member Avatar for aharkus

Aharkus, I'm sure your method could be made to work but there's a way to do this without using ids. Hence less to worry about in php. This demo uses jQuery though the same can be achieved (less concisely) in raw javascript: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" …

Member Avatar for Airshow
0
1K
Member Avatar for Pro2000

Troy, I recall some nasty cross-browser issues around reading/writing selected text. Does IE still have its own way of doing things or has Microsoft capitulated? [B]Airshow[/B]

Member Avatar for Pro2000
0
89
Member Avatar for ghosh22

Ghosh, [iCODE]window.open()[/iCODE] will always open a new window, pretty well regardless of parameters (providing any variables exist and are within scope). You probably need one of the following:- [CODE=javascript] location = url;//replaces the current page with the page specified by url, and make a new entry in the browser's History …

Member Avatar for ghosh22
0
213
Member Avatar for momonq1990

Momonq, I'm not sure why it's not working in ff but the volume of code can be significantly reduced with something like this: [CODE] <!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>tile calculator</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="../css/calculatorCss.css" rel="stylesheet" type="text/css" /> <style> h3 { …

Member Avatar for momonq1990
0
266
Member Avatar for tinker

Tinker, Your code and question are both difficult to follow. Can you post a corresponding HTML snippet so I can see what you are trying to achieve? [B]Airshow[/B]

Member Avatar for Airshow
0
310
Member Avatar for uselessninja

UselessNinja, That's an unnecessarily complicated approach. CSS will do the job for you with @media rules. [CODE] <style type="text/css"> /* General rules here */ @media screen { /* screen rules here */ } @media print { /* print rules here */ } </style> [/CODE] Read more about it here: [url]http://webdesign.about.com/cs/css/qt/tipcssatmedia.htm[/url] …

Member Avatar for urtrivedi
0
309
Member Avatar for astnrocker

Astnrocker, If I understand correctly, a hidden field is unnecessary. When the form is submitted (or serialzed if you are using ajax), the server-side code will see the "age" value and can apply whatever logic is necessary. Thus, all the logic for handling form data will be in one place, …

Member Avatar for Airshow
0
189
Member Avatar for f_atencia

[CODE]function eventHandler(e) { e = e || window.event; var target = e.target || e.srcElement; /* the rest of your handler here */ } [/CODE] This and more good tips here: [url]http://javascript.crockford.com/style2.html[/url] [B]Airshow[/B]

Member Avatar for Troy III
0
418
Member Avatar for mcwebalizer

Mcwebalizer, [CODE] marker.setMap(null); [/CODE] [iCODE]marker[/iCODE] still exists in javascript but is no loner displayed. To redisplay [iCODE]marker[/iCODE] on [iCODE]myMap[/iCODE]: [CODE] marker.setMap(myMap); [/CODE] [B]Airshow[/B]

Member Avatar for Airshow
0
131
Member Avatar for niche1

Niche1, In the document head: [CODE=javascript] onload = function(){ var ta = document.forms[0]['ta']; var taCount = document.forms[0]['taCount']; var maxChar = 6; ta.onkeyup = function() { this.value = this.value.substr(0, maxChar); taCount.value = maxChar - this.value.length; } }; [/CODE] And in the body: [CODE=html] <form> <textarea name="ta" rows="6" style="width:340px;"></textarea> <br> <input type="text" …

Member Avatar for Troy III
0
139
Member Avatar for AjithAnnadurai

Like this : [CODE=bbcode] [URL="http://www.gesneriads.ca/genach.htm"][IMG]http://www.daniweb.com/rxrimages/logo.gif[/IMG][/URL][/CODE] [B]Airshow[/B]

Member Avatar for ratnamstone
0
87
Member Avatar for f_atencia

I would guess that [iCODE]this.oProducts.Product[/iCODE] is an array or array-like object (such as a DOM collection) or a regular js object populated with properties named 1,2,3,4. [B]Airshow[/B]

Member Avatar for Airshow
0
84
Member Avatar for zjbarden

Zjbarden, Currently no time to get into this one too deeply but it appears (in Opera 11.50) that the fisheye menu effect is dependent on what has focus. If the effect fails I can reliably get it back by clicking the document background or any of the text divs but, …

Member Avatar for Airshow
0
238
Member Avatar for xagutxu

xagutxu, The reason why the first attempt did not work is that immediately the line ... [CODE=javascript] divTag.innerHTML = '<form action="foo.php" method="post" name="leh00" onsubmit="change_alert()">'; [/CODE] ... is executed, the browser's HTML parser automatically completes the open <form> tag by adding </form>. This is exactly the same error-tolerant behaviour you would …

Member Avatar for Airshow
0
1K
Member Avatar for destroyerx15

Destroyerx, It's hard to advise without knowing what you have already seen. Can you post the code given in the tutorial or a url please. [B]Airshow[/B]

Member Avatar for Airshow
0
66
Member Avatar for 7kemZmani

Adding table rows comes up with great regularity in this forum. My recommended approach is to hard code a prototype row in HTML, then insert a clone of it in response to whatever user event. The cloned row can be modified to give it the necessary content as required. I …

Member Avatar for Airshow
0
289
Member Avatar for 080346

String concatenate operator :- [LIST] [*]Javascript: + [*]PHP: . [/LIST] [CODE=javascript] window.location = "controller.php?command=delete&assetid=" + assetid; [/CODE] Moving between php and js to get some app working, I've done the same - many times. [B]Airshow[/B]

Member Avatar for Airshow
0
112
Member Avatar for apanimesh061
Member Avatar for haranaboy

Haranaboy, Level 1: How to write a Constructor function with methods added internally and externally. [CODE=javascript] function Objy() {//Constructor. this.text = ''; //This adds method .setText to Objy this.setText = function(x) { this.text = x; }; } //This adds another method, .display, to Objy Objy.prototype.display = function() { //A method …

Member Avatar for haranaboy
0
141

The End.