1,330 Posted Topics

Member Avatar for robert_b

Robert, You need to somehow inhibit form submission until all AJAX calls have been satisfied. Typically, you would do this with a function attached to the form's [ICODE]onsubmit[/ICODE] event and control submission by returning [ICODE]false[/ICODE] (to suppress) or [ICODE]true[/ICODE] (to submit). Your problem now becomes how to determine whether there …

Member Avatar for Airshow
0
113
Member Avatar for pietpiraat

Piet, Try this, including both 'minutes' and 'hours:minutes' presentation. [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <style> select.selectboxkl { width: 40px; } input.timedifference { width: 40px; text-align:right; } </style> <script> onload = function() { var startHSelect = document.getElementById("starttimehour"); var startMSelect = document.getElementById("starttimemin"); var endHSelect = document.getElementById("endtimehour"); var …

Member Avatar for Airshow
0
2K
Member Avatar for sgweaver

Sgweaver, As I understand it, all you need to do is to ensure, on page load/reload, that your divs are correctly shown/hidden in accordance with the state of various radio buttons and pulldown menus. You should be able to get away without setting a session cookie. You can make a …

Member Avatar for azegurb
0
272
Member Avatar for agr8lemon

Agr8lemon, This is pretty simple if you just want to show a single table row in response to a particular menu selection and to hide it when other selections are made. It's slightly more challenging to write efficient code that will handle [U]each[/U] menu selection to show a number of …

Member Avatar for Jackson TKL
0
4K
Member Avatar for mike3608

Mike, Whereas you can use [ICODE]+=[/ICODE] to append html, you can't use [ICODE]-=[/ICODE] to remove it. The reason is that [ICODE]-[/ICODE] is only ever a mathemaical operator (subtract). Also, consider the case where the user has added more than one row. You probably need a mechanism to delete each row …

Member Avatar for Airshow
0
86
Member Avatar for Manny7

Manny, I think you might want [ICODE]$("input#frmfirstForm-specializace").val($("input#frmfirstForm-specializace").val()+';;'+val));[/ICODE]. It's a bit long-winded but give it a try. [B]Airshow[/B]

Member Avatar for Airshow
0
95
Member Avatar for mmc2

MMC, You can certainly use AJAX to get prices but another approach is to serve all price information within the page in a form that allows javascript to access it with ease. Hence you have a fast, wholly client-side application from the point the page has been served right up …

Member Avatar for Airshow
0
2K
Member Avatar for azegurb

Hi Aze, try this .... [CODE=HTML] <head> <title>HTML ders | 09.07.2010</title> <script> onload = function() { sekil = [ "bir.jpg", "iki.jpg", "uc.jpg", "dord.jpg", "bes.jpg" ]; sekil.x = 0; sekil.allowSlide = true; sekil.tim = null; sekil.slide = function() { if( !document.images || !sekil.allowSlide ) { return; } clearTimeout(sekil.tim); document.images.az.src = sekil[sekil.x]; …

Member Avatar for azegurb
0
194
Member Avatar for azegurb

Something like this maybe : [CODE=XHTML] <!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"> var images = []; var imgData = [ { src:"bir.jpg", title:"bir"}, { src:"iki.jpg", title:"iki" }, { src:"uc.jpg", title:"uc" } ]; //Preload images. for(var i=0; i<imgData.length; i++ ){ images[i] = new Image(); images[i].src …

Member Avatar for azegurb
0
117
Member Avatar for beanryu

Beanryu, You said in your original post: [QUOTE=beanryu;942593]The <p> tags are created by the following js code: [CODE] paragraph = document.createElement("p"); text = document.createTextNode("first"); paragraph.appendChild(text); document.getElementById('mydiv').appendChild(paragraph); [/CODE] [/QUOTE] Therefore, you should have the means for javascript to remember the contents of these paragraphs without needing to retreive them from the …

Member Avatar for Ezzaral
0
5K
Member Avatar for OS_dev

OS_dev, You can't change the browser's native behaviour but you may be able to write your links to force [ICODE]location="...."[/ICODE] as opposed to the behaviour you are seeing in IE7. For example: [CODE]<a href="#SectionA" onclick="location=this.href; return false;">Section A</a>[/CODE] I haven't got IE7 available at the moment so I can't test. …

Member Avatar for Nappynick
0
149
Member Avatar for sugumarclick

Sugumarclick, The easiest way by far to avoid the problem you are experiencing is not to have an onclick event handler associated with your table cell; find an alternative way of achieving the required action. However, if you must have this event handler, then you can still achieve what you …

Member Avatar for littlealien88
0
1K
Member Avatar for kipl20

Kipl, Your code should work on the server and will do so if the .txt files have been uploaded and have the same relative path as those on your own computer. Standard unix permissions after FTP upload (644) appear to be adequate. I just tested my code (below) from a …

Member Avatar for Lee Turner
0
481
Member Avatar for ndeniche

On quick look, several things stand out: [CODE] var response; // xmlhttp response text //Not necessary or relevant at this point in the code. [/CODE] [CODE] if (xmlhttp.readyState==4 && xmlhttp.status==200){.....} // By performing both tests in one if(), you deny yourself the opportunity of independent elses, which is important for …

Member Avatar for achinaseller
0
382
Member Avatar for feoperro

Ashton, I'm not sure what you mean by "marquee" in this context but you seem to be describing a [URL="http://www.w3schools.com/css/pr_background-image.asp"]background-image[/URL] applied to a table. You may get cross-browser differences in exactly how it renders (viewport origin vs. element origin), so best test thoroughly. [B]Airshow[/B]

Member Avatar for rajarajan2017
0
173
Member Avatar for rs25

Rahul, Here's a quick test which may help shed some light : [CODE] <!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"> .wrapper { width: 340px; } .wrapper div { margin-bottom: 3px; padding: 5px; border: 1px solid #999; } .source { font-weight: bold; } …

Member Avatar for rs25
0
196
Member Avatar for Blacklister

I'm not sure what you mean by "timepicker" but maybe you want something like this: [CODE] function getDate24(d) { try { return d.getHours() + ':' + d.getMinutes(); } catch(e) { return false; } } [/CODE] which returns a hh:mm string when fed with a javascript Date. If something other than …

Member Avatar for Airshow
0
178
Member Avatar for sexyscott
Member Avatar for pwindsor

My guess is that [ICODE]onLoad="resizeIframeToFitContent(this)[/ICODE] fires before the AJAX request has been satisfied, so calculates new height based on the served (pre AJAX) rendering of the page. A workaround would be to get the AJAX response handler to call [ICODE]resizeIframeToFitContent()[/ICODE] as its last statement before returning. By leaving [ICODE]onLoad="resizeIframeToFitContent(this)[/ICODE] in …

Member Avatar for Airshow
0
292
Member Avatar for hsthompson

Thoughts : [LIST] [*]You would probably benefit from a formulation of [ICODE]create_request_object[/ICODE] that uses try/catch rather than testing [ICODE]navigator.appName[/ICODE]. There are many examples on the web. [*]Only kick off the update cycle after the page has loaded, otherwise a quick ajax response could generate a Javascript error and the whole …

Member Avatar for hsthompson
0
113
Member Avatar for whiteyoh

As far as I know this is an aspect that has not yet been addressed by the W3C. TMBK, Javascript's [ICODE]window.open()[/ICODE] has no knowledge of tabs and interpretation of the command is up to browsers (and their settings on individual computers). [B]Airshow[/B]

Member Avatar for Airshow
0
60
Member Avatar for gear26926

Gear26926, It works fine in IE6 and may also work in the even older IE5 but won't work in any other browser unless served from google.fr . [B]Reason[/B]: Most browsers block AJAX calls to "foreign" (ie 3rd party) domains. [B]Solution[/B]: Sticking with 100% client-side code .... I wish I knew. …

Member Avatar for Airshow
0
176
Member Avatar for vlowe

VLowe, Probably easiest to do this by lookup rather than a series of ifs. [CODE] <!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> var prices = { '4' : { '50' : '95.00', '75' : '103.00', '100' : '115.00', '125' …

Member Avatar for Airshow
0
286
Member Avatar for danarashad

[QUOTE=danarashad;1191833]var id1 = document.getElementById("sid").value; var id2 = document.getElementById("sid").value; var id3 = document.getElementById("sid").value;[/QUOTE] Dan, First, just in case you dont know, the three statements will obtain exacltly the same value but I guess you have a reason. OK, there are a few of ways to do what you want. If [ICODE]id1[/ICODE], …

Member Avatar for scrappedcola
0
103
Member Avatar for vitroblue

Vitro, I suggest you first make a test page with hard coded HTML to eliminate any client-side uncertainty: [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> <form id="form1" name="form1" method="post" onsubmit="" action="manager.java"> <select name="list1"> <option value="s0">right</option> …

Member Avatar for Airshow
0
141
Member Avatar for Atomika3000

You can accumulate your names/scores in a cookie if you want to but it's not necessary unless you need to remember the values between user sessions - eg. when the user shuts down the computer and starts up the next day. If you persist with the cookie, then you need …

Member Avatar for Airshow
0
110
Member Avatar for rukshilag

Rukshilag, Opening a new window to handle the print() is one way to do it but not the best IMHO. Make sure you test in a variety of browsers. Personally, I would write [ICODE]@media[/ICODE] rules into the CSS on the main page to control appearance/content of screen and print separately. …

Member Avatar for Airshow
0
153
Member Avatar for Roses89

I think I must be addicted to form scripting. [QUOTE] 1. A selection from the list in question 3 can only be made if the user selected at least one check box in question [/QUOTE] Simple. [QUOTE] 2. If the user enters a valid value in the question 5 text …

Member Avatar for Roses89
0
167
Member Avatar for ms_sws

MS_SWS, My first thought would be "Mime Type". The server on which I hold my sites incorporates a multifaceted monster called CPanelII, which includes a "Mime Types" link on the front page. The Mime Types page shows a whole raft of defaults plus the ability to add/modify. The intro at …

Member Avatar for fxm
0
556
Member Avatar for rukshilag

Rukshilag, Just call [ICODE]window.print()[/ICODE] from javascript, eg.: [CODE]<input type="button" value="Print" onclick="window.print();"> or <button onclick="window.print();">Print</button>[/CODE] With CSS [URL="http://www.w3schools.com/css/css_mediatypes.asp"]@media rules[/URL], you can control the print format to be different from the screen format. For example, you can suppress background images and navigation bars or choose a completely different color scheme. [B]Airshow[/B]

Member Avatar for Airshow
0
117
Member Avatar for nonshatter

nonShatter, [CODE=javascript]function setManufacturer(menu) { var field = menu.form.other_manufacturer; field.style.display = ( menu[menu.selectedIndex].value == 'other' ) ? 'inline' : 'none'; }[/CODE] [CODE=HTML] <select name="manufacturer" id="manufacturer" onchange="setManufacturer(this);"> <option value="man">--Manufacturer--</option> <option value="dell">Dell</option> <option value="ibm">IBM</option> <option value="other">Other</option> </select> <input type="text" name="other_manufacturer" size="35" value="" style="display:none;"> [/CODE] [B]Airshow[/B]

Member Avatar for nonshatter
0
166
Member Avatar for Doward

[QUOTE=Doward;1189562]..... if you need more information, please ask![/QUOTE] Like mentioning that this is an ASP.NET question? At least, that's what I assume from the word "Gridview" :S I think you will have more luck in the ASP.NET forum. It doesn't sound like a raw AJAX/Javascript thing. [B]Airshow[/B]

Member Avatar for Airshow
0
78
Member Avatar for benqus

Benkus, Try this : [CODE] var url = "open.php"; var params = [ "filename=" + document.getElementById("filename").value, "extension=" + document.getElementById("extension").value, "content=" + content, "path=" + document.getElementById("path").value ].join('&');//tidier xmlhttp.open("POST",url,true);//moved up xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.onreadystatechange = saveStateChanged; xmlhttp.send(params); [/CODE] You'll see I have deleted two [ICODE]setRequestHeader[/ICODE] lines. [ICODE]"Connection", "close";[/ICODE] is wrong if you want …

Member Avatar for Airshow
0
260
Member Avatar for myuncleisbob

muiBob, I'm guessing that your php is fine because it works with FF etc. There is a couple of things in the javascript/HTML that may be responsible for it not working in IE. I have given the code a throrough going over, resulting in this : [CODE=HTML] <!DOCTYPE html PUBLIC …

Member Avatar for myuncleisbob
0
117
Member Avatar for cjay175

On [URL="http://api.jquery.com/append/"]this page of the jQuery API[/URL], we learn from a contribtor's comment that : [QUOTE="Alex Dahman"]"The documentation should state that append(), appendTo(), prepend(), prependTo() and similar jQuery functions silently remove event handlers from a HTML document fragment string."[/QUOTE] With jQuery (etc.) always consult the API. The answer, or a …

Member Avatar for Airshow
0
6K
Member Avatar for nimareq

NimaReq, There are many ways to do this. Here's one using an optional custom HTML attribute [ICODE]target[/ICODE] to designate an active cell and the id of an associated cell: [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"> #myTable { border: 1px solid …

Member Avatar for Airshow
0
128
Member Avatar for mados

Mados, It took me less than a minute to "view source" and find that the slider is built with a jQuery plugin called [I]jCarousel Lite[/I], then to use google to find the [URL="http://www.gmarwaha.com/jquery/jcarousellite/"]official site[/URL] where it is well documented and available for download. That is nothing that you could not …

Member Avatar for Airshow
0
105
Member Avatar for Rohith Reddy

I think this is an ASP question, despite its AJAX angle. I can find nothing remotely familiar or comprehensible in the code and feel that denizens of the ASP forum might fair better with it. [B]Airshow[/B]

Member Avatar for scrappedcola
0
116
Member Avatar for fxm

FXM, What is your input string [ICODE]txt[/ICODE], that gives these results? [B]Airshow[/B]

Member Avatar for fxm
0
94
Member Avatar for Eccentric.2005

Jake, [QUOTE=Eccentric.2005;1182384]Is there anyway of doing this? [/QUOTE] The simple answer is yes, but I have to ask if you have considered encompassing all of page2's functionality within page1? Even if the server does some complex database stuff or grabs some XML feed before serving page2, and even if page2.htm …

Member Avatar for Airshow
0
77
Member Avatar for Corbula

Corbula, Demo: [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"> body, button, input { font-family: verdana; font-size: 10px; } .item { } .item { float:left; width: 200px; border: 1px solid #999; margin-right: 6px; } .item td, .item th { border: 1px solid …

Member Avatar for Airshow
0
3K
Member Avatar for dylank

Dylank, Try this : [CODE=javascript] onload = function(){ var divName = 'mouseFollow'; // div that is to follow the mouse // (must be position:absolute) var followDiv = document.getElementById(divName); var offX = 15; // X offset from mouse position var offY = 15; // Y offset from mouse position function mouseX(evt) …

Member Avatar for Airshow
0
470
Member Avatar for Atomika3000

This page won't work in its current form for a couple of reasons. Firstly, by using a submit button for Add Details, the form will be submitted and the page will reload. This effectively means that no entries can accumulate in the Javascript array. [B]Solution[/B]: Change "Add Details" to type="button" …

Member Avatar for Airshow
0
250
Member Avatar for jimminni

Jimminni, Javascript would be very limited as a screen saver. Native Javascript can only affect the contents of window(s) under its control but not their chrome. It can only close subordinate windows (ie windows opened by itself). It has no general authority over other applications or the screen as a …

Member Avatar for Airshow
0
76
Member Avatar for sa1support

sa1, I'm not sure why it's not working but you can certainly simplify your html and javascript significantly by using image replacement and a single function for all sections, 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"> .addimg { …

Member Avatar for sa1support
0
142
Member Avatar for Bobon

Bobon, You are on the right lines. Just a few things to fix. [LIST=1] [*]You need to pass the form fields' values to the validator functions rather than the fields themselves (DOM elements). [*]Ensure that each of the individual validator functions returns true (for OK) or false (for error). Most …

Member Avatar for Airshow
0
185
Member Avatar for amby

Amby, I think you will stand more chance by moving [ICODE]$('#result').html....[/ICODE] inside the success handler and JSON decode it, like this : [CODE] String.prototype.parseJSON = JSON.decode;//make sure you have the JSON lib loaded. $(document).ready(function() { $("button").ajaxStart(function() { alert('Triggered ajaxStart handler.'); }); $("button").click(function() { $.ajax({ type: "POST", dataType: 'JSON', url: "Testing.aspx/SendMessage", …

Member Avatar for Airshow
0
192
Member Avatar for ephemeral

The most obvious thing is that your httprequests are synchronous. [URL="https://developer.mozilla.org/En/Using_XMLHttpRequest"]Here[/URL], we learn that : [QUOTE=mozilla.org]XMLHttpRequest supports both synchronous and asynchronous communications. Note: You shouldn't use synchronous XMLHttpRequests because, due to the inherently asynchronous nature of networking, there are various ways memory and events can leak when using synchronous requests. …

Member Avatar for Airshow
0
154
Member Avatar for ms_sws

ms_sws, The only reliable way to test for file existance is to do it server-side in eg PHP, then build the page accordingly. If server-side programming is not available, then all is not lost because images fire either an [ICODE]onload[/ICODE] or an [ICODE]onerror[/ICODE] event in response to their [ICODE]src[/ICODE] being …

Member Avatar for Airshow
0
5K
Member Avatar for AdRock

One thing immediately jumps out at me. Case clauses don't need to be { bracketed }. Normal structure of a switch-case block statement is as follows: [CODE=javascript] switch(x) { case 1: ..... ..... break; case 2: ..... ..... break; case 3: ..... ..... break; default: ..... ..... } [/CODE] It's …

Member Avatar for theighost
0
213

The End.