1,330 Posted Topics

Member Avatar for MaristBrandi

Brandi, It seems that FF doesn't like that form of javascript URL. I have seen "javascript<b></b>" before but have no idea where it comes from. As far as I know the <b></b> has no place in there but would like to know why there are so many examples of it …

Member Avatar for theighost
0
368
Member Avatar for jrw89

JRW, For undefined members, [ICODE]typeof[/ICODE] returns [ICODE]"undefined"[/ICODE], which (somewhat confusingly) is not falsy! The reason is that [ICODE]typeof[/ICODE] always returns a string (including [ICODE]"undefined"[/ICODE]) and any string that is not empty is also not falsy. Empty strings are falsy. In fact, [ICODE]typeof[/ICODE] always unambiguously returns a string (unless its argument …

Member Avatar for jrw89
0
139
Member Avatar for Izzy123

Izzy, Try this: [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: Demo</title> <script type="text/javascript"> onload = function(){ var q1 = document.getElementById('q1'); var q2 = document.getElementById('q2'); var q1Options = q1.getElementsByTagName('input'); var q2Options = q2.getElementsByTagName('input'); var q2Labels = q2.getElementsByTagName('label'); var enableName = 'not visited'; var disable_q2 = function(value){ for(var …

Member Avatar for Izzy123
0
91
Member Avatar for baseballfury

Fury, Ultimately some line of code somewhere is using the result of getElementById(txtindex") instead of getElementById(txtupdate"). All you have to do is track it down. If it's not obvious then I would immediately suspect the use/reuse of a global (or outer) variable. Suggest you give this first consideration. To analyse …

Member Avatar for baseballfury
0
184
Member Avatar for chakde

Chakde, There's all-sorts wrong here. [CODE=javascript] function gm(guests) //shoud read function gm() { //guests is not used. var i=0; //can be simplified to var i; for (i=0;i=15;i++); //shoud read for (i=0; i<15; i++) //15 iterations (as per Shawn) //or for (i=0; i<=15; i++) //16 iterations (depending on what you want) …

Member Avatar for Taywin
0
96
Member Avatar for x_mysterious_x
Member Avatar for x_mysterious_x
0
118
Member Avatar for nakul_pancholi

Nakul, A hyperlink's href is just a way to send your browser to another page without you having to type its URL into your browser's address bar. To write a hyperlink, you work backwards, as follows : [LIST=1] [*]In browser, navigate to the Wikipedia page you want to link to …

Member Avatar for almostbob
0
99
Member Avatar for albertkao

Albert, It works fine in IE6, FF and Opera. I can only guess that [ICODE]document.mainform.unknownHw[/ICODE] doesn't exist or is not in scope at the point where you call [ICODE]setUnknownHw[/ICODE]. [B]Airshow[/B]

Member Avatar for almostbob
0
283
Member Avatar for Liammm

[CODE] ... var objHead = document.getElementsByTagName('head'); if(objHead){ objHead[0].appendChild(fileref); } ... [/CODE] I am surprised that [ICODE]...item(0)[/ICODE] works in any browser. [B]Airshow[/B]

Member Avatar for Airshow
0
129
Member Avatar for affee

Affee, It's this line : [CODE]var slideimages=new Array() slideimages[0]=<img src="../myadmin/stocklet/B3m2.jpg">; slideimages[1]=<img src="../myadmin/stocklet/C3m3.jpg">; slideimages[3]=<img src="../myadmin/stocklet/D3m4.jpg">; var ie=document.all;[/CODE] Change to : [CODE]var slideimages=new Array(); slideimages[0]='<img src="../myadmin/stocklet/B3m2.jpg">'; slideimages[1]='<img src="../myadmin/stocklet/C3m3.jpg">'; slideimages[3]='<img src="../myadmin/stocklet/D3m4.jpg">'; var ie=document.all;[/CODE] And I expect [ICODE][3][/ICODE] should be [ICODE][2][/ICODE]. If so then you can simplify to : [CODE]var slideimages = [ '<img …

Member Avatar for Airshow
0
163
Member Avatar for sniigg

Which element has [ICODE]class="close"[/ICODE], the <li> or something within the <li>? [B]Airshow[/B]

Member Avatar for Airshow
0
2K
Member Avatar for nathan_hastings

[QUOTE=nathan_hastings;1176288]This is fine unless I [COLOR="Red"]change the header location in the next line in PHP[/COLOR] as it automatically changes the page with showing the message.[/QUOTE] Can you post the code with that line in place please, so I can see exactly what is going on? [B]Airshow[/B]

Member Avatar for Airshow
0
140
Member Avatar for jrw89

JRW, I'm afraid ththe "onreadystatechange" approach is not generally applicable. It only applies to certain, very specific types of object. You might be tempted to use [ICODE]setInterval(...)[/ICODE] to monitor your object property but that's a very inefficient way of achieving your aim. If I understand correctly, a better way to …

Member Avatar for jrw89
0
186
Member Avatar for vantrax

Vantrax, Typical reason for difference in local/remote behaviour in something like this is the permissions on the counter.txt file. Most FTP clients allow you to set a remote (*nix) file's permissions, eg. in Cute FTP [I]right-click > Properties/CHMOD[/I]. It's probably 644 by default. 666 should do it. [B]Airshow[/B]

Member Avatar for Airshow
0
131
Member Avatar for jrw89

JRW, You can build a JSON string like that if you want ([ICODE]data[key] = value;[/ICODE] will get you started) but unless you particularly need a JSON string, you appear to be trying to replicate something that's native to HTML/browsers (and has been since time immemorial - ie Mosaic, IIRC). HTML …

Member Avatar for Eumenio
0
135
Member Avatar for peck3277

Peck, The main thing is that by using <button>Login</button>, the form's onsubmit event won't fire. Try putting an alert right at the top of validate_login(thisform) and you will find that it's never called. You can use : [LIST] [*][ICODE]<input type=="button" value="Login" />[/ICODE] for a standard button, or [*]eg. [ICODE]<input type="image" …

Member Avatar for Airshow
0
134
Member Avatar for Vigasdeep

Nothing immediately wrong but I suggest : [LIST][*]Avoid "extend". It's just possibly a reserved word (even though it's not part of the javascript language). [*]I guess that element '#abc' is a table. Try using <tbody id="abc">...</tbody> inside the table and add your row to it rather than directly to the …

Member Avatar for Airshow
-1
146
Member Avatar for mrcniceguy

MrNG, Without doubt - method 2. Otherwise you are reliant on someone else's server being up-and-running and still serving exactly the same version of jQuery on which you did all your rigorous testing when you built your app. Whereas Google are probalby as reliable as an organisation can get, why …

Member Avatar for mrcniceguy
0
87
Member Avatar for lifeworks

Life, There are many ways to formulate something like this in Javascript. Here's one: [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 :: Circle Object Demo</title> <script> function Circle(radius) {//By convention we give contructor functions an Initial-capital letter // *********************** // *** Private members *** // …

Member Avatar for Airshow
0
105
Member Avatar for s2xi

s2xi, There's nothing in native Javascript to help you I'm afraid other than : [LIST][*][B]Date.toLocaleString()[/B] : "returns a string version of the local time zone value of a Date object instance in a format that may be localized for a particular country or an operating system's convention."; Dynamic HTML, Goodman …

Member Avatar for Airshow
0
200
Member Avatar for albertkao

Albert, It sounds like your form is submitted and the server then re-serves the page identically to the way it was served the first time. Hence the form is devoid of the user's entered values. If you want the server to re-serve the page with the user's data in place …

Member Avatar for Airshow
0
104
Member Avatar for Th3nutz

Th3nutz, You could gop the AJAX route but there is little point unless the files contain data/text that is likely to change during a user session. For static or very slow changing information, you can serve all the data/text in all categories into its own div and show/hide when the …

Member Avatar for Airshow
0
94
Member Avatar for Tekkno

I guess you want something like this: [CODE=javascript] function callAHAH(url, pageElement, errorMessage){ var el = document.getElementById(pageElement); try { req = new XMLHttpRequest(); }// e.g. Firefox catch(e) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); }// some versions IE catch (e) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); }// some versions IE …

Member Avatar for Fungus1487
0
172
Member Avatar for Techsavy

You may get lucky here on Daniweb but I think you are going to struggle to find someone with the necessary experience to help you follow through with that particular approach. MS says [URL=http://msdn.microsoft.com/en-us/library/ms753804(VS.85).aspx]here[/URL]: "Customer feedback has indicated that it is often difficult for developers to build and run MSXML …

Member Avatar for Airshow
0
143
Member Avatar for jay.barnes

You could try : [CODE=javascript]val.substr(val.length-3, 1).match(/[A-Z]/i)[/CODE] There's no point testing for numbers again because [ICODE]!hasNumbers(val)[/ICODE] has already allowed anything with numbers to fall through this error trap. This would be a more rigorous test : [CODE]!val.match(/^[a-zçáéíóäëiöúàèììù]+[, ]+[a-z]{2}$/i)[/CODE] Read this as : "val does not consist of start of string an …

Member Avatar for Airshow
0
222
Member Avatar for masocha

Masocha, The W3C standards don't specify in great detail how radio buttons (and other HTML elements) should be rendered, therefore you will find differences from browser to browser and OS to OS. There is no universal solution to [U]native[/U] HTML/CSS rendering. If you want full control over appearance, then you …

Member Avatar for Airshow
0
91
Member Avatar for chathuD

chathuD, Sticking with basic coding, there's no particular advantage in having a [ICODE]new Image()[/ICODE] for the images already loaded automatically by the HTML. All you need for these is to store each image's src string so it can be recalled on mouseout. Meanwhile, the rollovers are not preloaded automatically so …

Member Avatar for chathuD
0
101
Member Avatar for s_kanika

Try [CODE]var message = document.chat_frm.msg.value; .replace(/\W/g, '');[/CODE] This will eliminate all characters that are neither letters, numerals nor underscores from the test. In other words, the test will only pass if there is at least one letter, numeral or underscore. The original text in the textarea remains unaltered. [B]Airshow[/B]

Member Avatar for Airshow
0
82
Member Avatar for Leratom

Leratom, Something like this maybe? [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>Untitled</title> <style> </style> <script> onload = function(){ var i; var myImgElement = document.getElementById("myImage"); var links = document.getElementsByTagName('a');//find all <a> links for(i=0; i<links.length; i++){//loop through the a links if(links[i].className === 'imgSelector'){//is it an "imgSelector" links[i].onclick …

Member Avatar for Airshow
0
90
Member Avatar for amby

There are some examples on the [URL="http://api.jquery.com/jQuery.ajax/"]jQuery.ajax() API page[/URL]. Apart from that, you shouldn't have too much trouble finding examples in this forum here on Daniweb. Or Google "jquery ajax tutorial" [B]Airshow[/B]

Member Avatar for Airshow
0
75
Member Avatar for meisterluv

Maybe [ICODE]if(isNaN(ln))[/ICODE] condition is met, therfore [ICODE]ln = 1[/ICODE] when [ICODE]document.radioForm.Radio.length[/ICODE] is say 'undefined'. If so, then maybe you could take some other action when [ICODE]if(isNaN(ln))[/ICODE] is met? [B]Airshow[/B]

Member Avatar for Airshow
0
69
Member Avatar for xxmp

xxmp, I can't see anything obviously wrong but can suggest a way ahead. First, reduce some uncertainty and reduce the need for [ICODE]document.getElementById()[/ICODE] in check_field() by reformulating the onblur code as follows : [CODE=javascript] <input type="text" onblur="check_field(this,'wrong_onoma')" name="onoma" id="onoma" maxlength="40" size="40" value="<?php if (isset($_SESSION["onoma"])) echo $_SESSION["onoma"];?>" /> [/CODE] Then, rewrite …

Member Avatar for Airshow
0
84
Member Avatar for kiyu2keith

kiyu, Something like this maybe? [CODE=HTML] <html> <head> <title>Online VOting System</title> <script type="text/javascript"> onload = function() { var count = 0; document.test.result.onclick = function() { count += (document.test.myradio[0].checked) ? 1 : 0; alert(count); } } </script> </head> <body bgcolor="#000099"> <form name="test"> <input type="radio" name="myradio" /> <input type="radio" name="myradio" /> <input …

Member Avatar for kiyu2keith
0
2K
Member Avatar for Hitman908

Hitman, Client-side (HTML): Use an [URL=http://www.w3schools.com/TAGS/tag_input.asp]input[/URL] tag with type="file:". Use something like <input name="myFileUpload" type="file"> for a field with "Browse..." button, by which the user will select the file to be uploaded. Server-side (eg. PHP): You need a script to [URL]receive the uploaded file[/URL] and to [URL=http://www.w3schools.com/php/php_mail.asp]generate/send an email[/URL]. Please …

Member Avatar for Airshow
0
73
Member Avatar for Ragnarok

You are doing the right thing. Javascript is at the heart of modern web applications. The old [I]wimp-off-back-to-the-server-and-reserve-the-page[/I] days are over. Watch and read everything you can find by [URL="http://www.crockford.com/"]Douglas Crockfird[/URL]. Then go out and buy some books (including his own). [B]Airshow[/B]

Member Avatar for Airshow
0
242
Member Avatar for Zurompeta

Hard to see why Chrome should not handle this. You could try changing the id's prefix, eg: [CODE]function updateName(num) { name = document.getElementById("myRef_"+num); } [/CODE] The variable should also be localised: [CODE]function updateName(num) { var name = document.getElementById("myRef_"+num); } [/CODE] otherwise a global variable is created. Do this instead: [CODE]function …

Member Avatar for Airshow
0
116
Member Avatar for dabobrow
Member Avatar for davidm23

It may be something to do with the CSS directive [ICODE]behavior:url(iepngfix.htc);[/ICODE], which generates an error as the page loads. Try removing this line. [B]Airshow[/B]

Member Avatar for Airshow
0
77
Member Avatar for achiman

Achiman, An onclick event in an input field can't be used to suppress form submission. The solution is simple but not obvious. You need to initiate validation from the form tag's [ICODE]onsubmit[/ICODE] event, and make sure you return the returned boolean value, like this: [CODE]<form action='myURL.php' method="get" onsubmit="return validate(this)">[/CODE] Then …

Member Avatar for achiman
0
111
Member Avatar for Jeyush

Jeyush, More info needed. [LIST=1][*]From which library is fadeSlideShow? [*]Can you post the as-served javascript rather than the php source? [*]At what stage do you get the javascript error; on page load or when the fader executes? [*]You imply that the error only occurs in IE. Is this the case …

Member Avatar for Airshow
0
97
Member Avatar for cfHutton

cf, I can't immediately see why it's not working however two things occur to me: [list][*]On repeated use the ajax success function would create more than one div with id="appLinks". I think this would cause $("#appLinks").append(......) to fail on second and subsequent calls (maybe without a Javascript error). [*]If the …

Member Avatar for cfHutton
0
175
Member Avatar for MDanz

For general internet deployment, you may have run into a dead end. I don't know of a general solution (thankfully) to overcome security constraints in all browsers. However for personal or intranet use, you can try developing an [URL="http://msdn.microsoft.com/en-us/library/ms536496(VS.85).aspx"]HTML Application[/URL] (HTA) for use with Internet Explorer. This will overcome some …

Member Avatar for Airshow
0
75
Member Avatar for cloud09

Cloud09, First, avoid the variable name [ICODE]submit[/ICODE]. It may be regarded as a keyword (because submit() is a method of form). Second, you should be able to use [ICODE]submitButton.disabled = true;[/ICODE] and [ICODE]submitButton.disabled = false;[/ICODE] without needing to switch between different butons. Third, if you really need to switch buttons …

Member Avatar for cloud09
0
132
Member Avatar for saiprem

Try replacing: [CODE]a3.appendChild(document.createTextNode("Cancel"));[/CODE] with: [CODE]a3.innerHTML = "Cancel";[/CODE] Also, if you ensure that [ICODE]couponCancel()[/ICODE] returns false, you can get rid of the line [ICODE]a3.href = 'javascript:;';[/ICODE], though this should have no effect on your IE8 problem. [B]Airshow[/B]

Member Avatar for Airshow
0
159
Member Avatar for pavankumarupper

There are two possible ways ahead: [LIST=1] [*]Learn how to write it yourself. [*]Find and install ready-developed code. [/LIST] [B]Airshow[/B]

Member Avatar for Airshow
0
64
Member Avatar for akabir77

Akabir77, It's not possible to call java/JSP function directly from javascript (same with php, asp, perl, ssi etc). Reason being javascript runs client-side (ie. in the browser); JSP runs server-side. No executable jsp is propogated client-side. Once your page has been served, the recent import of org.nipr.gateway_mgmt.GtwySysMgmtDao into the server-side …

Member Avatar for akabir77
0
70
Member Avatar for avinash_545

This line will generate an error : [CODE]document.getElementById('txt').innerHTML=h+":"+m+":"s;[/CODE] Change to : [CODE]document.getElementById('txt').innerHTML=h+":"+m+":"+s;[/CODE] Suggest you turn on javascript error reporting and/or look at your javascript error console. This will tell you the error type and line number. [B]Airshow[/B]

Member Avatar for avinash_545
0
112
Member Avatar for -Zarah-

Zarah, The HTML has a bunch of unbalanced <a> tags (all without </a>). As they do nothing, you might as well delete them. In DynamicDrive's example, the <img> tags are separated with space, not linefeed. Possibly significant? Whereas IE6 certainly handles linefeeds, maybe IE7/8 do not. [B]Airshow[/B]

Member Avatar for Airshow
0
143
Member Avatar for UberJoker

I'm not a perl person but I guess the various standard ways to make an http request apply: [LIST=1] [*]Traditional, old-fashioed hyperlink - eg. [ICODE]<a href="mycode.perl">[/ICODE] [*]Form submission - eg. [ICODE]<form method="get" action="mycode.perl">[/ICODE] [*]Scripted http request - eg. [ICODE]location.href = 'mycode.perl';[/ICODE] [*]AJAX - eg.: [CODE]xmlhttp = //etc. xmlhttp.open("GET", 'mycode.perl', true); …

Member Avatar for Airshow
0
3K
Member Avatar for jamey8420

I'm not too sure why you are having a problem but it may be solved with JSON, which allows you to bundle up multiple data items (four lists in your case), and return them in a single ajax response. JSON is made simple for aplication programmers by the availability of …

Member Avatar for jamey8420
0
195

The End.