2,040 Posted Topics
Re: Your question is a bit obscure. What type of value are you expecting a user to enter? What would you do if a user enter value in text 'A' and 'B', and then delete the value in text 'A' afterward? Do you want it to recompute all the time? Please … | |
Re: Your code is going to be out of bound. Array in Javascript is 0-index, not 1-index. Also, you need to read the scriptaculous tutorial about how to do it. I have never used it, but I can at least tell you that you are doing it wrong. You are not … | |
Re: Well, it is not about using JavaScript or server side to display a page, but it is about what you want and how concern in security. Often time, JavaScript is used to validate form and values. If you want quick validation, JavaScript would be fine; however, you may still need … | |
Re: You can just use random() function to get 2 images you want to swap. Then perform the swap between those two. You already have numImages variable, so you could random it off from that in your dimages[] array. [CODE] var firstIndex = Math.floor(Math.random()*numImages) var secondIndex = Math.floor(Math.random()*numImages) // caution: the … | |
Re: Yes, but it is url rewriting on your server side, not on JavaScript. | |
Re: Also make sure that the element you are trying to focus can be display (not hide or invisible) to the page. If its style display is 'none' or visibility is 'hidden', you could get the error. In addition, if the element has 'disable' property set, it cannot be focus as … | |
Re: If you are asking about Javascript, then add "onclick='A_JAVA_SCRIPT_FUNCTION()'" to the tag that you want it to perform a javascript script. If you are asking for "java" script, you are on the wrong forum. In this case, I assume that the HTML element you need to add 'onclick' event is … | |
Re: The code below demonstrates how to obtain selected value from select tags. Only desirable selected value would be listed inside 5 text boxes after a user click on the 'Finish' button. Because you said the selection can be up to 5, any of those that are not selected will not … | |
Re: As Airshow said, if value of any of your variable t, hd1 and chkin does not exist, it will break your JavaScript. If you have Firefox, you should install firebug to aid you in debugging (firebug will show you where the error occurs and from what possible reason). If you … | |
Re: Did you 'hard-coded' the mySQL look-up? I mean, it would be hard-coded if you specify the mySQL to look for a specific 'userName' in the data base. As a result, your mySQL will always return the same user. What you may need to do is either create a pool of … | |
Re: The problem is the code line below with your original script. [CODE]lis[z0].className=lis[z0]!=zxcobj?'off':'on';[/CODE] You may need to change to... [CODE]lis[z0].className=(lis[z0]!=zxcobj && lis[z0].className!="bold")?'off':'on';[/CODE] Hmm... 2nd page... Didn't see that... Sorry. | |
Re: You can use Google maps API (javascript library). Though, you need to register your IP with Google before you can use it. Go to [URL="http://code.google.com/apis/maps/signup.html"]http://code.google.com/apis/maps/signup.html[/URL] if you have not sign up yet. The page also have links for you to look for how to use it. | |
Re: Supposedly, each of your LI tags has a unique ID (and it should otherwise you shouldn't call it ID), you can access the element directly using getElementById(ID). [CODE] //HTML part ... <li class="on" id="change1">blah</li> <li class="on" id="change2">blah</li> ... //JavaScript when call example <input type="button" value="change class 1" onclick="chgClass('change1')"> <input type="button" … | |
Re: I would think that FckEditor website should have a forum or tutorial for this. I never used FckEditor but tinyMCE. Their website has a wiki and explain how to add your own button/functionality. I would expect FckEditor to have some sort of information as well because it has been existing … | |
Re: No, you don't have permission to go across web page. How would you find where the other page is located at? Even if the page is on the same website, you still can't access it directly. There is a workaround but the value in the other web page must be … | |
Re: [CODE]<SCRIPT LANGUAGE="JavaScript">[/CODE] This is not supposed to be only 'javascript'. It should be...<SCRIPT LANGUAGE="text/JavaScript"> [CODE] yr = (yea.value) ; m = (mon.value) ; d = (day.value) ; [/CODE] Where are yea, mon, and day variable? You have not declared them earlier, so they are unknown to browser. [CODE] if ((navigator.appName … | |
Re: [CODE]<INPUT name=newdistshare> <INPUT type=checkbox Name="newdistdefault">[/CODE] Not sure but your attribute 'Name' should be 'name'. That's the only thing I am seeing from a quick look here... | |
Re: 1. As Troy III said, you are not supposed to have 'script' tag inside a .js file. If you have it, remove it. 2. Where is the .js file? Is it in where it is supposed to be -- js folder? Assuming your HTML file is in folder 'myHTML', your … | |
Re: Why do you need php in order to display the value of the variable? You could simply use it. [CODE] <script type="text/javascript"> function test(aVariable){ document.getElementById("php_code").innerHTML=aVariable // you could use aVariable.toString() if you want to but may not get different result } </script> [/CODE] | |
Re: [QUOTE]hi, im new here, and i cannot find the topic for Writing a program to find the power of any given number that is basic enough,im a beginner, if anyone can help me or just giving me a link to an existing thread like this..i will appreciate it very much... … | |
Re: I'm not sure if this really work. Is an email supposed to start with a dot? Also, there are other format which is a valid email would not pass this regexp... 1) .@abc.com --> shouldn't it suppose to fail? (obviously, no email name contains only '.') 2) [email]abc@-.com[/email] --> shouldn't … | |
Re: I don't know how to answer your question? It has no detail at all. Define "navigation menu"? Define what "menu" should be like? What it is used for? How do you want to cooperate JavaScript with it? Etc... Please do not expect people on the forum to understand what you … | |
Re: You need to read about Ajax. Though, Google have their own way of indexing the search list, so don't expect that your page will be the same speed as Google. | |
Re: Your validation in your code is somewhat odd. 1.It is not a good idea to keep redeclaring new whole arrays just to clear only 1 event you set out using setTimeout(). 2.Why would you check for dat.innerHTML==null if the 'dat' could be null itself before you can check for innerHTML … | |
Re: Your question is very vague. Even though I do not really want to help you but it turned out to be quite an unexpected good exercise. A sample code is below... [CODE] <html> <head> <script type="text/javascript"> function displaySomething(aID, formID) { var el = document.getElementById(aID) if (el) { el.style.display = null … | |
Re: [CODE]e.style.top= document.getElementById(txtid).parentElement.offsetTop+35;[/CODE] There is no such 'parentElement' in FF. You should use 'parentNode' for FF. Not sure if IE also accepts that; otherwise, you need to check for client browser before you attempt to do so. | |
Re: Are you sure that the error is actually occurred in this line? Could it possibly be from previous lines (incorrect parentheses matching)? | |
| |
Re: The not working part could be from browser cache? | |
Re: I think it depends on how you add table rows. I am not sure why you need 'input' tag inside the form for? You are preparing to add new table row with each submission of values in input tags? Anyway, a sample code dynamically add table row with adding sum … | |
Re: You mean a user highlights a portion of text and you use JS to copy the text portion? IE, FF, and Chrome read value of range selection differently. If I remember correctly, IE uses document.selection, FF uses window.getSelection(), and Chrome uses window.getSelection() but with value of setBaseAndExtent. Search for those … | |
Re: Why not use the Servlet to generate javascript code as well? If you don't want to do that, then use Servlet to generate HTML page and put the value in an HTML element value (if you define an ID to the element, it would be easier for javascript to find … | |
Re: It is difficult to try to help you without seeing any code or image of the page. Anyway, I will try. The way to remove the seat number from text box should be similar to how you add the seat number to the text box. The only different is that … | |
Re: [QUOTE]1. You neglected to end each line with a ;[/QUOTE] You don't need to end it with ';' anymore unless you are trying to code it in 1 line. :) | |
Re: A sample code is below. [CODE] <html> <head> <script type="text/javascript"> var opt1 = ["usCity1","usCity2","usCity3"] var opt2 = ["mxCity1","mxCity2","mxCity3","mxCity4"] var opt3 = ["cnCity1","cnCity2","cnCity3","cnCity4","cnCity5"] function displayCity(selID, subSelID) { var dispElem = document.getElementById(subSelID) if (dispElem) { // ensure that display element exists var selElem = document.getElementById(selID) if (selElem) { // ensure that source … | |
Re: This [URL="http://stackoverflow.com/questions/760422/how-can-i-close-a-window-with-javascript-on-mozilla-firefox-3"]link[/URL] should answer and solve your question if you are talking about firefox. | |
Re: Maybe you should look into 2 things - SQL injection and Cross Site Scripting (XSS). These 2 are common in attacking website database/content. Then you should have more understanding about prevention. By the way, do not use ONLY JavaScript to validate user input. The JavaScript is for convenient but not … | |
Re: Sorry, can't suggest you anything without sample code. The problem with your explanation is that I do not know how you deal with icon and how you put your icon in the page. | |
Re: Yes, but you need to use 'onSubmit' in the form tag to change the radio button to be disabled. A sample code is below... [CODE] <html> <head> <script type="text/javascript"> function demo(form) { var rads = form.radd for (var i=0; i<rads.length; i++) { rads[i].disabled = true } return true } </script> … | |
Re: Why would you add the 'id' property to 'option' tag? Would it be OK to use the value as '$partner_id' instead of '$contact_name'? If you want contact_name, you could use select.options[select.selectedIndex].innerHTML to get the contact_name instead. It is redundant... What if you remove the 'id' property and use 'value' property … | |
Re: Not sure you would get only 1 'body' from your tag (may get an array with 1 element). Shouldn't you use document.getElementsByTagName("BODY")[0].style.backgroundImage = img ??? Also, not sure if the image would be shown if it is not loaded yet. You may need CSS for it. | |
Re: If the 'custno' is a JavaScript variable, you could use it without quotation marks around it (<a href="WI_testweb/"+custno+".xls">). I am not sure whether or not speedscript is JavaScript??? | |
Re: [QUOTE]displaying 3d models is the easy part[/QUOTE] How a browser do that on a webpage??? | |
Re: Could you please post the code portion? By explanation is not really enough to pin point the issue. | |
Re: And what is IT COMPANY you are talking about??? And how much knowledge you know about JavaScript? You should read about what is and how JavaScript works, so you would get an idea what it is. | |
Re: The problem is on line 5, you end it with a slash '/' instead of a comma ','. Because your code has improper line break, your code is invalid. If you are not sure about line breaker or copy codes from others, you should try to merge all multiple-line code … | |
Re: The link is broken. Also, sorry... I am not familiar with JQuery because I don't use it. | |
Re: [CODE]parseInt (startHSelect.value)[/CODE] This is dangerous and may not give you the right value in your case (string number has leading '0'). Instead, all of your parseInt should be... [CODE]parseInt (startHSelect.value, 10)[/CODE] | |
Re: Are you sure this is how the code should be? I corrected those misplaced double quotes, but I am still not sure; especially the last part of the code... What are 'dirty' properties? [CODE] <div class="Block FeaturedProducts Moveable Panel" id="HomeFeaturedProducts" style="display:%%GLOBAL_HideHomeFeaturedProductsPanel%%"> <h2 dirty="false">%%SNIPPET_HomeFeaturedProductsFeed%%%%LNG_FeaturedProducts%%</h2 dirty="false"> <div class="BlockContent"> <script language="javascript"> // SPECIFY … | |
Re: The problem is that you can't directly access attribute 'name' using '.name' in FF (not sure in IE). You need to use function getAttribute(attributeName, flag) instead. The 'flag' value can be left out. [CODE] if(x.elements[i].id=="check") { jhon[i]=x.elements[i].getAttribute("name"); } else if(x.elements[i].id=="text"){ jhon1[i]=x.elements[i].getAttribute("name"); } [/CODE] Hope this help. |
The End.