2,040 Posted Topics
Re: The problem is that you are rewriting the content of 'div' you are attempting to extend content. Also, it is a wrong way to dynamically extend HTML nodes in a page. The solution is not as simple as you though but it is not that difficult. You should create HTML … | |
Re: [CODE] Array.prototype.max = function() { var max = this[0]; var len = this.length; [/CODE] 'this' in this case is an array which is a local variable to 'Array' class object. [CODE] function initArray(){ this.length=initArray.arguments.length [/CODE] 'this.length' in this case is the number of arguments passed to the function initArray. You … | |
Re: You need to get the display element by either go through DOM (parentElement.subelementName...) or directly access via the element ID (document.getElementById(elementId)). Then assign/append the value to the display element's value or innerHTML depending on what type of your display element (input/textarea -> value, div/span -> innerHTML). If you still does … | |
Re: If all options you are talking about are independent (use them as criteria of search), you should produce and display the result on the server side; otherwise, use JavaScript to narrow the selection down before you let the server side display the result. I still believe that your selections would … | |
Re: What you need to do is to look for parent node where your selection is. By the way, are you intend to use this editor only on FF? Because it may not work properly using execCommand() on IE. On the top of my head right now, you could use <your_range_selection>.getRangeAt(0).startContainer.parentNode … | |
Re: [CODE]sum=sum + parseInt(chemtests[i]);[/CODE] In that portion, use [CODE]sum=sum + parseInt(chemtests[i], 10);[/CODE] instead because the parseInt has a bug when the number has leading 0 in front. Forcing it with base 10 would solve the problem. | |
Re: If you use 'display' property, the object will not be in the display layout; as a result, the line up may be messed up. The other property 'visibility' allows your object to still be in place but not being display; however, the area will become empty which may not be … | |
Re: The loadurl() accept a php page, right? Why did you overridden the page coming in? The argument should be used in composing where you want your ajax to call to. Then, in your calling, you did not initialize what URL ajax needs to call but attempt to send it out. … | |
Re: I think it should be... [CODE]<form action="submit.html" onsubmit="return validate_form()">...</form>[/CODE] instead of... [CODE]<form action="submit.html" onsubmit="validate_form()">...</form>[/CODE] EDIT: This is old thread!!! | |
Re: I may have to ask you to post your code snippet where you add/remove/change the content of your dropbox2 when a choice in dropbox1 is selected? | |
Re: [CODE] var write = document.getElementById('write'); var erase = document.getElementById('erase'); var display = document.getElementById('righttext'); var name = document.getElementById('name'); var email = document.getElementById('txtEmail'); var number = document.getElementById('txtNumber'); var confs = document.getElementById('confsun'); var confm = document.getElementById('confmon'); var conft = document.getElementById('conftue'); var confw = document.getElementById('confwed'); var confth = document.getElementById('confthur'); var colls = document.getElementById('collsun'); var … | |
Re: In onclick function, you need to change a bit. You have assignment '=' instead of comparison '==' in the if statement. Anyway, I also add to check if the username field is filled with only white spaces. [CODE] // original code function make_blank() { if(document.login.username.value ="Username"){ document.login.username.value =""; } } … | |
Re: You could have a look at [URL="http://www.quirksmode.org/js/detect.html"]http://www.quirksmode.org/js/detect.html[/URL] which may give you a somewhat better idea? | |
Re: Can't you just change it to... [CODE] function starttimer8(t) { /* set your parameters( number to countdown from, pause between counts in milliseconds, function to execute when finished ) */ startCountDown(t, 1000, clearit); } [/CODE] If I were you, I would code it differently... Sorry, but your code is not … | |
Re: Why use iframe tag? Also, this is not really useful because when someone thing about WYSIWYG editor, a portion of text style could be changed. This code snippet is too simple and not really useful for me. You may try again but work with range selection (cross-browser if you want … | |
Re: Do you want to insert the whole string starting from <script... or you want to insert a certain part? If it is the whole string, you could simply put it in the input tag value. I assume that your target input is 'Email'. [CODE] document.getElementById("Email").value = "<script language=\"JavaScript\" type=\"text/javascript\" src=\"http://www.ABC.com/members/display.php?token=email\"></script>" … | |
Re: The way asmira suggested is correct (even though there are many other ways to deal with). I just want to add some thing here if you are going to go that way. 1) You must not have multiple forms with the same name. 2) The check for name does not … | |
Re: I don't have PHP installed in my computer. Also, as Graphix said, your code is very messy and very difficult to read. One thing I would point out is that you assign a new 'text' string into innerHTML of a 'table' tag? I am not sure it will work well … | |
Re: Not sure about JQuery because I don't use it... Anyway, I am looking at your code and I see only 'click'. Could you also add 'mouseover' into it as well? I mean, the 'click' to me looks like 'click' event, so 'mouseover' may be another event you want o use … | |
Re: To me, this doesn't look like you are appending value to the existing value but rather attempting to append the same attribute to the input tag... I don't use JQuery, so I am not sure the right way to fix this. If it is pure JavaScript, I could. | |
Re: There is such a type of 'number' for input tag. Not sure where you got the idea from??? Anyway, a suggesting revised code is below. The function takes the form ID and obtain input values from the form's input elements. The 'correction' is 'readonly' so user wouldn't accidentally change it. … | |
Re: Are you using swfobject.js? Have you include it before you call? What error are you seeing? Can't tell you anything much because your information is too brief. Please provide much more information next time when you want to ask something. Here is a [URL="http://code.google.com/p/swfobject/wiki/documentation"]documentation link[/URL] for swfobject.js (if it is … | |
Re: [CODE] $method[name] $desc[instructions] [/CODE] Are you sure that it is correct? Shouldn't it be string instead of just plain variable-liked inside the []? (i.e. $method["name"] and $desc["instructions"]) | |
Re: I think you have problem with how you access DOM with JavaScript and how to do HTML here. First problem, you do not call getAttribute('onmouseout') because 'onmouseout' is an event which is automatically taken care by browser. As a result, you do not need to check for attribute because it … | |
Re: [CODE] function SetCookie (name,value,expires,path,domain,secure) [/CODE] @Pabaharm, you need to set the cookie as above function in the js file. The only argument you need to remember is the 'name' of the cookie in order to retrieve it in any other pages. Use GetCookie(name) to retrieve the cookie you set. | |
Re: It's nice that you are trying to learn more. From looking at your code, here is my comment... 1) I believe you are coding it on IE only. One obvious difference that this code won't work on FF is that the value of style pixel does not have 'px' at … | |
Re: You can't just simply use JavaScript to send mail for you. You need to have authority of the sender email and connect to your email provider, and then you can send out your email. Pure JavaScript can't do the job... | |
Re: There is a way to do it in Flash, but I am not sure about JavaScript alone. | |
Re: First, you should not use 'p' tag to do this. 'p' tag does not require closing tag and it would not be safe. You should use 'span' or 'div' tag instead. Second, your if-else statement syntax looks more like psudo code instead of JavaScript syntax. Third, you get DOM element … | |
Re: What is 'validate()' function? To validate the input? Why do you have to assign 'onclick()' to your 'vis' button? Also, the way you assign onclick() would not result what you want because functions do not concatenate but they are being replaced until the last one is assigned (setWeight). Ok, now … | |
Re: You are getting the default toString() when you call System.out.println() of the PalletLocations object. You must explicitly write your own toString() or expand the call of System.out.println() to display all the object infos you want to display. | |
Re: You need to get rid of your ternary assignment in order to accomplish what you want. [CODE] // @param obj an object for changing its class name (style) function Cngclass(obj, act){ var currObj; for (var i=0;i<ids.length;i++) { // should always use 'var' for safer reason currObj = document.getElementById(ids[i]); if (obj.id … | |
Re: On line 10, it is not safe to use value from an input text as integer right away. Certain browser version may think that it is a text and would just add string '1' to it instead of an integer. Use parseInt(value, base) to fix this. On line 19, it … | |
Re: Also, this seems to be the same as other post asking for idea. This forum is not for asking for idea to do your homework... | |
Re: How about break it down into two classes for HTTP and Database connection executors? This way, it would be more explicit and ensure that users should use different executor for different type of connection? | |
Re: Don't think this question is for javascript??? Or you are talking about attempting to do the comparison of dates obtained by mysql on a HTML page? | |
Re: Another suggestion is that when you accept an input from user and want to use it as an integer, ensure to convert it to integer using parseInt(value, base) before you use it. In this case 'inp' should be converted as [code] inp = parseInt(inp, 10) [/code] before you use it; … | |
Re: [quote] multiple definition of `messages' [/quote] Should be a clue for you. It means that you have the same definition declare for 'messages'. It also tells you exactly where it is first declared and at what line. The rest of the errors are similar type. | |
Re: I hope that your 'merge' definition means 'concatenate'. If your meaning of merge is similar to set union, concatenate won't do it. Just want to make sure. [quote] There is yet a third option that would apply if you needed to keep distinct values where you would loop through the … | |
Re: At line 251, are you using NewJFrame class or NewJFrame1 class? Also, you have 'NullPointerException' thrown at line 219 when you try to add. How do you compile your code? You need to read and interpret the error message... | |
Re: Could you please use the 'code' tag on the top of the box you are posting? It is very difficult to read your code in plain text. [CODE] <a href="#" class="articleLink"> Show Article 1 </a> <a href="#" class="articleLink"> Show Article 2 </a> <a href="#" class="articleLink"> Show Article 3 </a> [/CODE] … | |
Re: Hmm... This post is from the same person but the code looks a little bit different... The loop will never be executed properly because.. [code] // this line of code does NOT get the last letter from input // but it is looping from the last letter until the first … | |
Re: [CODE] if (word1.substring(0).equals(word.substring(15)) [/CODE] As NormR1 said, does your enter string always length 16? If you want to check for the last character, use the string.substring(string.length()-1) instead. NOTE that string.length()-1 because it is 0-index. In other words, the first character is at position 0, so the last position is at … | |
Re: If you are trying to grab the dimension of an image right after your page is loaded, you could use a function in IE (can't remember the name of that function). Though, if you want it to be cross browser, you need to attach a variable flag to your window.onload. … | |
Re: If you are talking about writing to client's local storage, not sure there would be any that do it with JavaScript. The reason is JavaScript is not allowed to access local storage for security reasons. You are not only trying to access local storage but attempting to write content, this … | |
Re: Not sure about using text file to store username + password if it is under Windows. Even Linux would not really support the way you are asking for. Encrypting is one, but it is not that safe if you have a physical file which can be accessed on the storage … | |
Re: How do you implement these methods of these classes -- DataBuilder.getCharacters(), DataBank.getMeanings(), and DataBank.getReadings()? | |
Re: I guess you are talking about navigation menu, not sub button. I am not sure how much knowledge in JavaScript you have. There are many ways to do this from scratch; besides, there are many js libraries(files) you can use. Also, are you using pure JavaScript from client side or … | |
Re: Sorry, but this forum tends to be rather solving problem than showing. Besides, your code is too long to sit down, look at, and give comments... | |
Re: Do you completely understand how to use BlindDown? I am not sure whether you need 'new' in your code. Not sure whether the BlindDown really read it as it should be. I am not certain because I read this [URL="http://www.tutorialspoint.com/script.aculo.us/scriptaculous_blinddown_effect.htm"]page[/URL] about BlindDown... |
The End.