1,330 Posted Topics
Re: 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" … | |
Re: 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() + … | |
Re: 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] | |
Re: 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] | |
Re: 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] | |
Re: [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] | |
![]() | Re: iAm, Looks right. Could you mark ""solved please. [B]Airshow[/B] |
Re: 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 … | |
Re: 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 … | |
Re: Bloto, Check out your js error console. Line 70, "echo" is not a js command. [B]Airshow[/B] | |
Re: 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 … | |
Re: 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 … | |
Re: 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] | |
Re: 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) { … | |
Re: [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 … | |
Re: 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 { … | |
Re: 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" … | |
Re: 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 … | |
Re: Just HTML? Then ask in the HTML forum. [B]Airshow[/B] | |
Re: 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 … | |
Re: 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] | |
Re: 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 … | |
Re: 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; … | |
Re: 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] | |
Re: 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] | |
Re: 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, … | |
Re: 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 { … | |
Re: 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 = … | |
Re: 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 … | |
Re: 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 … | |
Re: 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] | |
Re: 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" … | |
Re: 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] | |
Re: 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 … | |
Re: 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 { … | |
Re: 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] | |
Re: 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] … | |
Re: 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, … | |
Re: [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] | |
Re: 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] | |
Re: 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" … | |
Re: 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] | |
Re: 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] | |
Re: 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, … | |
Re: 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 … | |
Re: 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] | |
Re: 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 … | |
Re: 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] | |
Re: 1. Study hard for a maths degree. 2. Code it up. | |
Re: 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 … |
The End.