1,330 Posted Topics

Member Avatar for ryoonnet

Ryoonnet, I'm afraid there's no complete solution because the browser security gets in the way. As Taywin indicated, some browsers (including the one you use) don't allow input fields of type="file" to be given a value by any means other than clicking "browse..." and selecting file(s). However, there is a …

Member Avatar for Airshow
0
276
Member Avatar for travist

Travist, The probelm is in these two lines: [CODE] var var1 = document.getElementById("div1").className; if (var1.value == "special") [/CODE] Change to : [CODE] var var1 = document.getElementById("div1").className; if (var1 == "special") [/CODE] or [CODE] var var1 = document.getElementById("div1"); if (var1.className == "special") [/CODE] The second version has the advantage that you …

Member Avatar for Airshow
0
105
Member Avatar for yopirates

Yo, [ICODE]window.showModalDialog[/ICODE] is new to me. I would put the onload handler in the page(s) that appear in the popup; app.html and any others. If the onload handlers are complex or need access to data in the main window, then get the popup's onload handler to call function(s) in the …

Member Avatar for yopirates
0
953
Member Avatar for andrewliu

Andrew, Is [ICODE]thumbsUp[/ICODE] supposed to be different from [ICODE]the_id[/ICODE]? They are currently identical : [CODE=javascript] the_id = $(this).attr('id'); thumbsUp = $(this).attr('id');[/CODE] The second line here will immediately override the first. The spinner will never show : [CODE=javascript] // show the spinner $(this).parent().html("<img src='images/spinner.gif'/>"); //show the thumbsup $(this).parent().html("<img src='images/yes-enb.JPG'/>"); [/CODE] Why …

Member Avatar for andrewliu
0
128
Member Avatar for djcrab

I just tested your code in the following browsers: [LIST] [*]IE6 : With return true, shows message onmouseover. With return false, default behaviour then shows message onmouseout. With no return value, behaves as return false. [*]Opera : With return false, shows message onmouseover. With return true, default behaviour then shows …

Member Avatar for Troy III
0
117
Member Avatar for DrViolet

DrV, I think you will find it difficult to override IE's natural behaviour in this respect. In both browsers, the back button performs a "soft reload" of the page but it would appear that in FF it is softer than in IE. It appears that IE remembers form data but …

Member Avatar for Airshow
0
102
Member Avatar for ptemedia

Ptemedia, Approach 1: As the page is composed server-side, you may be able to test whether each image exists or not, and then include HTML only where the test is positive. I guess asp is capable of this (php certainly is). Approach 2: Client-side, there is indeed a way to …

Member Avatar for Airshow
0
211
Member Avatar for MartinRinehart

Try [ICODE]textarea.innerHTML[/ICODE] instead of [ICODE]textarea.value[/ICODE]. Both generally work though .innerHTML is more logical given that, in (X)HTML the value is set between the tags, not as a value="..." attribute. [B]Airshow[/B]

Member Avatar for Taywin
0
275
Member Avatar for muloki

In a shop, you set the prices in whatever currency is appropriate. The user should never need to enter a currency symbol and you should never need to read/deltect one in its symbolic "£" "$" form. If your shop has user-selectable currency modes, and your client-side or server-side code needs …

Member Avatar for MartinRinehart
0
66
Member Avatar for sundeep_g

SunD_g, I guess the function is executed more than once and you end up with an unknown number of added <input> elements named "nameN", "nameN+1", "nameN+2", "nameN+3", "nameN+4" etc., where N is a positive integer. One strategy would be to write N to a hidden form field each time the …

Member Avatar for Airshow
0
283
Member Avatar for eswar.aspire
Member Avatar for Airshow
0
149
Member Avatar for star_lavender

[QUOTE=star_lavender;1356328]Hi. I have a calculate.js javascript file where all the function that execute the calculation is consist in this file. Now, I want to retrieve a data from the database for javascript calculation and be done in this calculate.js file. I have search a lot of methods to do this …

Member Avatar for star_lavender
0
145
Member Avatar for webdev2111

Webdev, I can offer a strategy: [LIST=1] [*]Choose your player (WMP, Real etc.) [*]If available, download and thumb through the player's SDK. If not available, then read whatever documentation is available. You should find instructions on (a) skinning and/or (b) custom ebmedding, typically with worked examples. [*]Create artwork - use …

Member Avatar for Airshow
0
83
Member Avatar for ivan3510

Ivan, I have never written an editor from scratch but I have hacked a few over the years. [QUOTE]How to make a button (source code) that when someone clicks on it, it shows the source code of that what is written.[/QUOTE] Do you mean you want to toggle between [I]Markup …

Member Avatar for ivan3510
0
183
Member Avatar for Airshow

Reviving an old question ...... any chance of an [COLOR="Green"][B]ICODE[/B][/COLOR] button in the Daniweb editor? I use [COLOR="Green"][B]ICODE[/B][/COLOR] almost every time I post and on every occasion I think "still no button". I've read in earlier posts here that vBulletin is difficult to edit in this regard but I'm sure …

Member Avatar for Airshow
4
204
Member Avatar for chineerat

Chineerat, It depends on the purpose of the array. Is is to store a [I]snapshot[/I] or the [I]history[/I] of values in the input fields? [LIST] [*]Snapshot: We would overwrite each entry when it is updated. [*]History: We would add new entries without destroying anything. [/LIST] [B]Airshow[/B]

Member Avatar for Airshow
0
160
Member Avatar for himmat.m4

Himmat, First, the options need values: [CODE=HTML] <select name="listFrom" id="listFromId" onchange="loadXMLDoc()"> <option value="">SelectCity</option> <option value="Pune">Pune</option> <option value="Karad">Karad</option> </select> [/CODE] Then, myDiv can be initially empty: [CODE]<div id="myDiv"></div>[/CODE] The "lsitTo" menu will be overwritten with response from the servlet. If you want a "lsitTo" menu populated with destinations, then you need …

Member Avatar for Airshow
0
164
Member Avatar for filch

Dave, On a quick looksee: [CODE=javascript] var input = $('<input type="text" name="delegate" id="delegate" />');//an instance of jQuery .... var newInput = input.clone();//also an instance of jQuery .... $(newInput).attr({'name': 'delegate' + (i + 1), 'id': 'delegate' + (i + 1)});//$(something_that_is_already_an_instance_of_jQuery)... .... newInput.attr({'name': 'delegate' + (i + 1), 'id': 'delegate' + (i …

Member Avatar for Airshow
0
3K
Member Avatar for ErlendHL

Congrats. Here's a way of doing it by setting a custom attribute, [I]selected[/I], which gives us something reliable to test. Color changes are effected by switching class names. [CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link type="text/css" href="http://3rlend.com/pjatt/pjattstyle.css" rel="StyleSheet"> <style type="text/css"> * …

Member Avatar for Airshow
0
137
Member Avatar for vedmack

Vedmack, I'm not sure why the gif should decide not to animate. It works in IE 6. Maybe it's a bug in the version of the browser (presumably IE) that you are using. As far as I can tell, [ICODE]window.createPopup[/ICODE] is proprietary Microsoft. I have certainly never used it or …

Member Avatar for Airshow
0
115
Member Avatar for <?davec

Davec, There must be many ways to do this. Here's one, which is both practical and fun. First wrap existing code in a contructor function to avoid putting lots of members in the global namespace. Here it is with a few tweeks including the ability to specify callback function(s), which …

Member Avatar for Airshow
0
110
Member Avatar for nikc121

Nikc, Many folks use [ICODE]document.formName[/ICODE]; it's thoroughly reliable. I stopped using validators a while back. They are oft-times more trouble than they are worth. What really matters is whether or not the code works, cross-browser, not conformance with a standard that the browsers are [U]supposed[/U] to comply with. If, for …

Member Avatar for Airshow
0
372
Member Avatar for cutekate

Ramya, I would like to help but need clarification : [COLOR="Green"]I want to display [U]the contents of the table[/U] based on the third menu selection[/COLOR] There's only one table and its contents are already displayed. Is there another table, or do you want to modify/add to the contents of the …

Member Avatar for Airshow
0
127
Member Avatar for fobos

Fobos, The trouble is you have [I]one[/I] variable, [ICODE]toggleState[/ICODE], being influenced by [I]two[/I] checkboxes. In fact, you generally don't need variable(s) to record checkbox state (checked or unchecked) because you can enquire the checkboxes themselves at any time. (They know their own state with incredible reliability!) Try this: [CODE=javascript] function …

Member Avatar for fobos
0
96
Member Avatar for eefh01

To do this without refreshing the page, you need to use : [LIST][*]AJAX to make a request to the server and to receive a response. [*]DOM scripting in the "success" response handler to change what is displayed[/LIST] That should point you in the right direction without adding to a mountain …

Member Avatar for Airshow
0
95
Member Avatar for mushget

Mushget, You will most probably end up using a regular expression. Tyr [URL="http://regexlib.com"]here[/URL] - search on "currency". I had a quick look and couldn't see exactly what you want but there were plenty more results. [B]Airshow[/B]

Member Avatar for Airshow
0
127
Member Avatar for akvlko

Failure of [ICODE]element.focus()[/ICODE] is a known bug in Chrome. I have not been able to identify a workaround. [B]Airshow[/B]

Member Avatar for akvlko
0
115
Member Avatar for MDGM
Member Avatar for lgriess

LGR, I think you need to loop inside the success callback fn. With a loop counter i counting up from 0 try replacing [ICODE]get(0)[/ICODE] with [ICODE]get(i)[/ICODE] (4 times). I'm not sure about [ICODE]$.each[/ICODE]. Maybe is disappears if loop is employed. [B]Airshow[/B]

Member Avatar for Airshow
0
178
Member Avatar for meghab

MegHab, You can do this one of two ways. On each cycle :- [LIST=1] [*]compose the next page's URL in JSP and insert into a META REFRESH (Google search if you don't know what it is) [*]compose the next page's URL and go to it after 1 second (1000 milliseconds)in …

Member Avatar for Airshow
0
100
Member Avatar for Flightfanatic1

FF1, [ICODE]document.getElementsByClassName[/ICODE] is not universally supported, so it's better to do something like this: [CODE=javascript] function innertest() { var divs = document.getElementsByTagName("div"); for(var i=0; i<divs.length; i++ ) { if(divs[i].className == "findme") { alert(divs[i].innerHTML); } } } [/CODE] Of course, this will only find [I]divs[/I] with [ICODE]class="findme"[/ICODE]. If you want to …

Member Avatar for Airshow
0
294
Member Avatar for SanJuanWolf

Hi guys, I guess this problem is still live, though it's a month old now. I'm in a part of Damiweb here where I don't normall go. You will generally find me in the JavaScript / DHTML / AJAX forum. [B][U]The good news[/U][/B] I have a general solution for "n …

Member Avatar for Airshow
0
221
Member Avatar for aizel

Aizel, How is this line served ("view source" in the browser)? [CODE] hs.graphicsDir = '<?php get_bloginfo('template_url'); ?>/rssSlider/highslide/graphics/'; [/CODE] Does it give the correct path to your graphics? [B]Airshow[/B]

Member Avatar for Airshow
0
292
Member Avatar for azegurb

Azegurb, Wow! I'm not too sure what's going on there. Behaviour is rather strange, and it's to do with addressing the checkbox elements as the collection [ICODE]qutu[/ICODE]. I'm actually amazed it works as well as it does, 'cos I didn't know you could do that. For reliability I would take …

Member Avatar for azegurb
0
221
Member Avatar for eagled2

Eagled, Suggest you start by tracking down the code that initialises the second menu after it has been delivered via AJAX. Does such code exist? Is it called? Does it successfully attach Easy Tabs functionality to the second menu? [B]Airshow[/B]

Member Avatar for eagled2
0
146
Member Avatar for lovepong

LoveP, [CODE=javascript] function hardReload(fromServer) { // Perform a hard reload of the document. // This kind of reload resets form elements to their default values // Call with hardReload(false) to retreive from browser cache (if available) // Call with hardReload(true) to force the page to be re-served by the server …

Member Avatar for Airshow
0
181
Member Avatar for eijei

Eijei, The problem doesn't manifest itself if you hit "Enter" to clear the alert as opposed to clicking OK. Therefore, I think you just need to give focus back to the window after the alert. [CODE] ... alert ("Time expired"); window.focus(); ... [/CODE] You may need to do this after …

Member Avatar for Airshow
0
238
Member Avatar for jecris

Jecris, For lots of ideas, try sticking "hangman" into Daniweb's search (top of page). There are plenty of results, which indicate that this has been a popular exercise for some years. [B]Airshow[/B]

Member Avatar for jecris
0
384
Member Avatar for AboJaD

AboJaD, The solution can be quite concise. Delete the entire script (sorry) and paste in this: [CODE=javascript] onload = function(){ var menus = ['Closed', 'S_B1', 'S_C1', 'S_E1', 'S_G1', 'S_I1', 'S_J1', 'S_M1', 'S_O1', 'S_S1', 'S_S2'];//list of secondary menu ids for(var i=0; i<menus.length; i++) { menus[i] = document.getElementById(menus[i]);//translate ids into DOM elements …

Member Avatar for Airshow
0
170
Member Avatar for Shanti C

Shanti, I try to avoid debug alerts when working with real-time code (inc AJAX) as they suspend execution and can mess up the timing. For example, say your ajax function has a timeout. An alert in the ajax response handler could (depending on where it is placed) eat into the …

Member Avatar for Shanti C
0
137
Member Avatar for monstercameron

[QUOTE=fobos;1351932]Did you write this or copy it. If you copied it, then you need to learn javascript and stop asking people what you want. We are here to fix problems that people have on there codes, not code that people copied and have no idea how it works. Sorry for …

Member Avatar for monstercameron
0
341
Member Avatar for seekinghelp
Member Avatar for iijb

iiJb, getAsDataURL() is FF-proprietary, not W3C and therefore not universally implemented cross-browser. Apparantly, there's a W3C draft on this interface but no clues to from MS as to whether or not it might be implemented in IE. [URL="http://blog.igstan.ro/2009/01/pure-javascript-file-upload.html"]This article[/URL] seems to give chapter and verse. [B]Airshow[/B]

Member Avatar for Airshow
0
70
Member Avatar for ClaireShutt

Claire, [CODE] var latstr = tempstr.split('|'); [/CODE] [ICODE]String.split()[/ICODE] forms an Array automatically. [B]Airshow[/B]

Member Avatar for Taywin
0
103
Member Avatar for Staggasaurarts

The reason for the jump is that [ICODE].tabContent[/ICODE] height is momentarily lost, and the page shrinks to a size that will fit the window ... hence verical scroll goes to zero (top of page) and does not recover naturally. The simple way to overcome this is to give [ICODE].tab_container[/ICODE] some …

Member Avatar for Airshow
0
132
Member Avatar for julianmoors

Julian, Quick look at the Mootools API indicates you need to use `var myProp = myElement.getProperty(property);`([see here](http://mootools.net/docs/core/Element/Element#Element:getProperty)) So for alt text, I guess you would use `var myProp = myElement.getProperty('alt');` It's up to you how you identify `myElement` to be the <a> of interest. If in doubt, consult the API.

Member Avatar for Airshow
0
115
Member Avatar for nikc121

Your code works fine with the function in <script></script> tags on the page. If the code does not work with <script src="numbers.js"></script> then it's because : [LIST] [*]numbers.js doesn't exist [*]numbers.js exists but is in the wrong place [*]the function has not been cut/pasted into numbers.js correctly. [/LIST] Once you …

Member Avatar for kracko
0
931
Member Avatar for sassenach

Sassenach, It's not obvious where it's breaking down. Code looks pretty good to me. It can be simplified to avoid repetition. See below, including (commented out) suggested debug statements to allow you to inspect the composed URL without issuing the .load() command. [CODE=javascript] jQuery(document).ready(function($) { //References var $pages = $('div#paging_menu …

Member Avatar for Airshow
0
178
Member Avatar for bhavesh561988
Member Avatar for Brillig
0
63
Member Avatar for richardmorris

Richard, It all depends on how your javascript function [ICODE]popUp[/ICODE] is written. Post the code and I'll have a look at it. [B]Airshow[/B]

Member Avatar for Airshow
0
206

The End.