1,330 Posted Topics
Re: AbsJaD, Try this: [CODE=javascript] function reportsendipp() { var ippsEl = document.getElementById('ipps'); var memberEl = document.getElementById('track'); var ippsVal = (!ippsEl) ? null : Number(ippsEl[ippsEl.selectedIndex].value); var memberVal = (!memberEl) ? null : Number(memberEl.value); if(!ippsVal || ippsVal===-1) { alert('First, choose a type'); return false; } if(!memberVal || isNaN(memberVal) ) { alert('Member/track value must … | |
Re: Chintan, Your code should work providing [ICODE]value[/ICODE], [ICODE]hd1[/ICODE] and [ICODE]chkin[/ICODE] exist. Otherwise javascript will generate an error. I generally build search strings like this in an array, then use Array.join() to put the pieces together. [CODE] var searchString = []; searchString.push("t=" + value); searchString.push("hid=" + hd1); searchString.push("chkin=" + chkin); var … | |
Re: Julian, Without sight of your php, we have to make some assumptions here. Let's assume: [LIST=1] [*]search.php accepts its pagination instruction of the form [ICODE]search.php?key=kkkk&search=sssss&page=N[/ICODE], where N is the page number, starting at 1. [*]The php generates page links of the form [ICODE]<a href="">N</a>[/ICODE], where N is the page number, … | |
Re: Ankur, You will have to do some background reading. I would start here: [url]http://docs.jquery.com/Tutorials:Using_AjaxPro[/url] [B]Airshow[/B] | |
Re: Artvor, You DOUBLE POSTED this problem!!!!!!! I just spent time providing you with a solution in the [URL="http://www.daniweb.com/forums/thread314647.html"]other topic[/URL] then found this one already well underway. You are in good hands with Hielo but please don't double post. [B]Airshow[/B] | |
Re: Drew, I'm, not in a great position to help as I've not used either easeOutBounce or Cufon but I can offer a strategy. I think you need to explore easeOutBounce vs. Cufon as the cause of the problems in IE. Make copies of your page: [LIST] [*]easeOutBounce ON Cufon OFF … | |
Re: Artvor, It's much simpler to attach onclick handlers to the <LI> elements than the <UL> element. This way, you avoid cross-browser issues with deternining [ICODE]xcevt[/ICODE] and [ICODE]zxcobj[/ICODE]. All that part of the code disappears. [CODE=html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Airshow :: Untitled</title> <style type="text/css"> … | |
Re: Chin, In my experience it's much easier to perform all calculations on every occasion (a la spreadsheet) rather than selectively keeping up with the latest user input. Hence you only need one function, which can be attached as onblur handler to all user input elements. I guess there must be … | |
Re: Techie, First extend [ICODE]Date[/ICODE] to add a [ICODE]setDateTime[/ICODE] method, which accepts a string of the necessary format : [CODE=javascript] Date.prototype.setDateTime = function(dt, ignoreTime) { try { ignoreTime = (!ignoreTime) ? false : true; dt = dt.replace(/\s+/g, ' ').replace(/^\s/, '').replace(/\s$/, '');//reduce multiple spaces to single space, then purge any leading and … | |
Re: MackAttack, What you really want is something called a "combo box" or "combobox" - Google it and you will get plenty of hits. If you want to do your own thing then you could do something like this : [CODE=html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> … | |
Re: H, The code can be simplified and made more useful as follows: [CODE] function countup(yr, mon, d) { var montharray = [ "Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" ]; var d = new Date(montharray[mon-1] + " " + d + ", " + yr); var today = new Date(); today.setHours(0); today.setMinutes(0); today.setSeconds(0); today.setMilliseconds(0); //today is … | |
Re: If that sort of thing was scriptable, it would be a hackers delight. They would do all sorts of nastiness to our computers. Short of writing something viral (and certainly not in javascript), I think it safe to say that it can't be done. [B]Airshow[/B] | |
| |
Re: cmcc, Status of 0 is normally associated with a local file (eg. c:\\mydocuments\....) as opposed to a properly delivered web page, complete with http response headers. Also, both [ICODE]onsubmit[/ICODE] functions should return [ICODE]false[/ICODE], to suppress normal HTML form submission, otherwise the submit buttons will initiate an ajax call then cause … | |
Re: Steve, In the old days, IE had a rather convoluted way to do this while Netscape (iirc) was incapable, but now there's a much friendlier way. After creating DOM element [ICODE]myTextbox[/ICODE] and populating it with your text : [CODE] myTextbox.focus(); myTextbox.select(); [/CODE] I'm not sure if this is 100% universal … | |
Re: EthHunt, The script is attempting to do some AJAX (Google it if you don't already know what AJAX is) to get a data file from somewhere (probably a remote server). Reading betweeen the lines (I'm guessing), the site is provided on a disk and the script was tested several years … | |
Re: RYY, [CODE=javascript] //Standard onload = function(){ var el = document.getElementById('city'); if(el){ el.onblur = myfunction; } }; //jQuery $(document).ready(function() { $('#city').blur(myfunction); }); [/CODE] In both cases you could alternatively insert an anonymous function in place of the function name [ICODE]myfunction[/ICODE], like this : [CODE=javascript] //Standard onload = function(){ var el = … | |
Re: Hwestman, There are many ways to formulate this, eg. : [CODE=html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Airshow :: Untitled</title> <style type="text/css"> button.headline { margin-right: 3px; } </style> <script> onload = function(){ var headlines = [];//new Array var headlineButtons = document.getElementById('headlineButtons'); var showHeadline = function(x){ for(var … | |
Re: Max, Do exactly what qazplm said. [CODE] var whitelist; chrome.extension.sendRequest({greeting: "whitelist"}, function(response) { whitelist = response.whitelist; console.log(response.whitelist);//working }); alert(whitelist);//alerts "undefined" [/CODE] [B]Airshow[/B] | |
Re: K, After a MASSIVE tidy up and a with completely different approach to controlling random images (and captions), we end up with this : [CODE=html] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>random test</title> <meta http-equiv="X-UA-Compatible" content="IE=7"> <meta name="google-site-verification" content="nBLAHBLAH BLAH"> <meta name="google-site-verification" content="n6Lv0vE-0pHJ8t2nbZMJ1kxeE9cM-6AUegAVUUJ1CPA"> <link href="http://newpw.delphi-ts.net/test/newpw.css" rel="stylesheet" … | |
Re: Andrew, The only thing that jumps out at me is that the FORM has [ICODE]method="POST"[/ICODE] while the PHP expects "GET". If this doesn't fix it then you need a debug strategy. I suggest splitting the thing down the middle - test client-side and server-side independently. 1. TEST THE REQUESTING PAGE … | |
Re: cJay, You're half way there. Assuming both buttons are both of [ICODE]type="submit"[/ICODE], you can do something like this : [CODE] document.ready(function(){ $("#saveform_ns").click(function(){ $('form#form_main').attr({action:"http://path/to/save.php"}); return true; }); $("#processform_ns").click(function(){ if( validate(this.form) ){ $('form#form_main').attr({action:"http://path/to/process.php"}); return true; } else { alert('Sorry, form did not validate'); return false; } }); }); [/CODE] Just make sure … | |
Re: Techie, Try building your HTML string like this: [CODE=javascript] var strArray = [ "</br>", "Enter Name ", "<input type='text' id='myText' />", "<input type='button' id='theSubmitButton' value='Edit Name' onclick='edit_data(", hash_a, ")'/>" ]; $("#details_a").append(strArray.join('')); [/CODE] The line number in the error message will give you a better clue. There may be an apostrophe … | |
Re: On page load, you get a javascript error "console is undefined" at line 89 [ICODE]console.log("Lower than or at 1024 width. Setting display to 1024 width or lower");[/ICODE] You need to track down why that is happening. [B]Airshow[/B] | |
Re: Alil, The main problem is the criterion for deciding whether the chosen bag is single or double. [ICODE]if (randomnumber>single)[/ICODE] will always equate to true, so only single bags can be chosen. In the absence of anything to prevent it, singles go negative! Here's a working version (with a few tweaks): … | |
Re: What you describe is the natural behaviour in a textarea. No scripting required. [B]Airshow[/B] | |
Re: Razor, No amount of javascript or CSS can force a browser to display png images if it is not equipped to do so. The simplest solution is to use gif images instead. Gifs support animation and transparency but not partial transparency. If you want to give users of modern browsers … | |
Re: Anandhikrishnan, What Qazplm says or more conventially: [CODE] var el = document.getElementById("search"); var id = (el && el.options.length) ? el[el.selectedIndex].id : null; [/CODE] For the record (and if I recall correctly) obtaining value directly with [ICODE]selectElement.value[/ICODE] is problematic in that some browser(s)/version(s) return 'undefined'. A safer way to get value … | |
Re: Anuran, Post your html/javascript so we can see what you have thus far. [B]Airshow[/B] | |
Re: Aizel, Yes it's possible but the solution is highly depenedent on what you have already coded. Can you post the code are you using to animate the slide show please? [B]Airshow[/B] | |
Re: Ebo, Are you sure this is right? [CODE=javascript] function testChecked(form) { var formcount = document.forms.length; .... for ( var cntr = 0; cntr <= formcount; cntr++ ) { .... } [/CODE] Maybe my misunderstanding but the function appears to be checking a single form but then loops through all forms … | |
Re: Siberian, First, put your brain in gear. Then edit the following line to add the missing word: [CODE=javascript]alert("I want a car with " + work_car.seats + " yeah");[/CODE] [B]Airshow[/B] | |
Re: B, You are 90% there. Just a few tweeks necessary. The main problenm is that the menuContainers have [ICODE]position:absolute[/ICODE], which (if I understand correctly) is giving the wrong visual effect. The CSS can be simplified by using classes to avoid unnecessary repetition. There's an extra [ICODE]</div>[/ICODE] in the HTML, which … | |
Re: I have seen the same question a dozen times recently, on Daniweb and elsewhere. Is it by any chance a school/college exercise? [B]Airshow[/B] | |
Re: Nikita, If you want to build/manipulate Locations then you might like to try my LOCATION constructor: [url]http://www.daniweb.com/code/snippet217388.html[/url] It is quite well documented and probably overkill for what you want but maybe useful to remember for the future. [B]Airshow[/B] | |
Re: LifeWorks, Trouble is that although [ICODE]main_image[/ICODE] remains available to the anonymous function, [ICODE]i[/ICODE] will be one greater than the index of the last element in [ICODE]all_items[/ICODE] by the time the anonymous function executes. However, judicious use if [ICODE]this[/ICODE] (and some tidying) will overcome the problem. Try: [CODE=javascript] var i, all_items … | |
Re: bbFury, It's much simpler intercept form submission with an onsubmit handler that tests to see if submission has already been attempted and returns true (allow submission) or false (suppress further submissions) accordingly. You will need a "submitted" boolean flag, initialisd to false. With a little ingenuity, you can avoid using … | |
Re: [QUOTE]It is not possible to apply Tipmage to more than one image in a single page [/QUOTE] It's not clear why this should be so, but I guess it's something they will fix some time. Meanwhile, I guess you could try serving each image into its own IFRAME, which is … | |
Re: Techie, There's a couple of ways to do this. Here's one, not involving the Date() constructor: [CODE=javascript] function dateTime_split(time){ var d = time.split(' ')[0]; var t = time.split(' ')[1]; return { year : d.split('-')[0], month : d.split('-')[1], date : d.split('-')[2], hr : t.split(':')[0], min : t.split(':')[1], sec : t.split(':')[2] } … | |
Re: [QUOTE=webdev2010;1183774]So far most of my web development experience has been in HTML... I am looking to create a design form similar to one found at [url]www.alliancetag.com[/url]. Basically I will just produce 2 colors of paper, 2 sizes, with 2 lines of text but I want the end user to be … | |
Re: VaVa, Suggest you try [URL=http://www.thesitewizard.com/css/excludecss.shtml]this[/URL] before proceeding any further with a javascript solution. [B]Airshow[/B] | |
Re: Or even simpler if the links are on the same page as the paragraphs: [CODE]<html> <head> <title>Test</title> </head> <body> <a href="#p1">Go to Paragraph 1</a> <a href="#p2">Go to Paragraph 2</a> <a href="#p3">Go to Paragraph 3</a> <a href="#p4">Go to Paragraph 4</a> <a href="#p5">Go to Paragraph 5</a> <a name="p1"></a><p>This is Paragraph 1</p> <a … | |
Re: Aldm, [CODE=Javascript]var sifra=$("input#password").val();[/CODE] [CODE=HTML]<input id="password" type="password" value="" />[/CODE] [B]Airshow[/B] | |
Re: ..hank.., Is that an ASP.net question? If so then you might do better here: [url]http://www.daniweb.com/forums/forum18.html[/url] | |
[B]INTRODUCTION[/B] Have you ever wanted to pass data from one web page to another when server-side scripting is unavailable, and without setting a cookie? Ever wanted an efficient way to build url query strings? Well now you can. [B]SOLUTION[/B] It is maybe little realised is that data can be successfully … | |
Re: SM, Stack overflow is unlikely to do with images, though it could be to do with code that handles images (eg a preloader). A stack overflow generally arises from a non-terminating recursive call. In other words, a function that calls itself but with no conditional test to prevent it calling … | |
Re: Ari, The general form of a web page is as follows: [CODE=html]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Airshow :: Untitled</title> <style type="text/css"> </style> <script> </script> </head> <body> </body> </html>[/CODE] The !DOCTYPE can vary but [ICODE]XHTML 1.0 Transitional[/ICODE] is a pretty good one to become familiar with. … | |
Re: George, This works for me (IE, FF & Opera): [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <script type="text/javascript"> onload = function(){ var currentBG; var imgs = [ "url('http://www.daniweb.com/rxrimages/logo.gif')", "url('http://img1.cdn.adjuggler.com/banners/Client847175/1280785292729_728x90.gif')" ]; function cng(x) { if(document.body) { x = ++x%imgs.length; document.body.style.backgroundImage = imgs[x]; return x; } } var … | |
Re: Silvershaft, Yes but you might do better by posting in the PHP forum. [B]Airshow[/B] | |
Re: Ash, The reason you only ever see [ICODE]-1[/ICODE] is that in all cases, by the time the alert() statement executes, [ICODE]i[/ICODE] has incremented to 6 (the exit condition for the for loop), thus [ICODE]num - i[/ICODE] is [ICODE]-1[/ICODE]. When each delayed function executes, it uses the [I]extant[/I] (then existing) value … |
The End.