2,040 Posted Topics
Re: I am not sure what you mean by 'tabs'... Does it mean it is on one page with multiple data entry fields? If you want to screen the input data before submit, you should check it when the form data is being submit using JavaScript. However, if the information is … | |
Re: Do you mean the value inside the first row at its corresponding column is bigger than other rows? If so, you just need to iterate through row=1 to s.length. The reason is that you already know and will access your first row (row=0) every time you check. Also, when you … | |
Re: I am assuming that walk left foot and right foot both calls 1 step. I am not sure that is the right way to count as step... If it is, then please read the comment below. 1)Why do you have firstStep() method? nextStep() does the same job. You could initial … | |
Re: Would this [URL="http://www.daniweb.com/forums/thread350611.html"]thread[/URL] help? It looks the same to me. | |
Re: If you are willing to use FireFox, the browser has a great tool for JavaScript called 'Firebug'. It is very easy to use and allows you to see where the error is right away. It should help you learn JavaScript too. | |
Re: @Shnackhag, Hmm... I think your definition for running EXE is different from what it should be here. Don't think a browser would allow you to just take whatever content from running a exe from the server. Running exe from the server is one thing, but browser accept and stream it … | |
Re: Line 5, you declare variable 'fname', but in line 10 you use it as 'fName'. | |
Re: If you are looking for editor, TextPad is free and so is JGrasp. They both are good editor for coding Java. I usually use TextPad more than JGrasp because of its fast loading (the program itself). | |
Re: You are using an IDE? Because it looks like your compiler doesn't find your jar file where you assigned it to... | |
Re: You could pass the text/xml result from the ajax when it is done to a JavaScript, and then use the function to populate your result in your predefined HTML elements? | |
Re: Why are you using 'onkeypress' while the form itself have 'onsubmit' event for you? Also, your HTML code is in malform... A form tag cannot be inside a Table tag that way... [CODE] <script type='text/javascript'> function login(){ if (document.forms["login"].email.value=='') { alert('You must enter an email to login!'); return false; } … | |
Re: If you are using matrix.length, then you don't need line 17 and 18. Actually, you already know that the 2D array (you called matrix) has length 8x8, so only one constant variable would be enough. Unless you don't want to use the constant variable but keep using matrix.length, then you … | |
Re: What you need is 'auto-complete' for the field. You cannot use combination of combo-box with text field... You should be able to find a js library/file that someone has implemented it. It was quite a hot topic a while back ago about implementing auto-complete form. | |
Re: That's a tool. If you are going to learn Java, learn how to program Java before learn how to use the tool. The tool is huge, complex, and could discourage beginner easily. | |
Re: For the time, you could use a Timestamp object created at the beginning and each point you want to check. Check out the any related Timestamp class (could be Date, Time, or something... can't remember). In graph, you need a bit of computation. I usually implement from scratch from 2D … | |
Re: What you may need is to add class's variables for each of the direction inside your existing class (MazeBot). Then increment the direction value each time your robot has made a decision to move to in your while( !this.isAtEndSpot() ) loop. Then you can print out the result at the … | |
Re: Read your first error, it said that you are missing an open parenthesis right at line 109. In other words, it is a syntax error. You should look at the error message and follow the suggestion... By the way, code tag please... | |
Re: You need to specify what type of ArrayList you are using. You cannot declare your variable that way. You should read the ArrayList [URL="http://download.oracle.com/javase/6/docs/api/java/util/ArrayList.html"]API doc[/URL]. The way you use is ArrayList<E> variableName = ArrayList<E>(); where E is a type of java object class and cannot be primitive (int, long, double, … | |
Re: I'm not sure how your algorithm in your code work... You tends to manipulate file content instead of read the whole thing, work with it, then write out the whole thing. It would be much easier to deal with the whole string all at once because you will iterate through … | |
Re: [CODE] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Temperature Converter</title> <script type = "text/javascript"> <!-- function calculateCelsius() { var form = document.getElementById("formTemp"); var value = parseInt(form.fahrenheitInput.value); form.celsiusInput.value = (9.0 / 5.0 * value + 32) +"F"; } function calculateFahrenheit() { var form = document.getElementById("formTemp"); … | |
Re: Your code is not completed as you know that the splaySearch() is missing. Also, when you are asked to verify a code, you should start from verifying methods which do not call any other method first. Then keep going up the tier. If you are not sure about the correctness … | |
Re: You need to implement equals() method inside your class. If you implement equals(), you may need to implement hashCode() (or hashValue()??) for it as well... For now, equals() may be enough... | |
Re: Why did you need to pass 'this' to the MyWIndowAdapter? Also, why does your windowClosing() try to show the frame again? Just use System.exit(0) instead. | |
Re: What is myPicture.area()? How did you implement it? Also how did you implement contains()? If you are not sure it is hit, implement the else statement for it and display the value of the mouse location. | |
Re: Using "return function(args)" has one down side -- it will always perform the function regardless what buttons you click (except reset type). If you have only 'submit' button, then it should work fine. | |
Re: Do you want each char for different color??? Also, you need to understand what drawChars() method arguments are... You only set color when you found a character which is supposed to be different color; otherwise, you set the color to default color. The drawChars() will be the same for all … | |
Re: In line 42, you declare buffer as a pointer of T type. In line 50, you allocate an integer to the buffer. Then in line 58, you are using it as a pointer again??? | |
Re: Could you show me your HTML? It depends on how you construct your HTML. Also, do you use JQuery library or just raw JavaScript? | |
Re: The problem you encounter right now is that you declare 'found' outside the for-loop scope. Once it is changed to 'true', it will always be 'true'. You need to initialize the value of 'found' before the checking loop. You did it, but it is incorrect. Only modify your line 16 … | |
Re: Do you understand the equation? The x you are looking for is the input value to find out what the z-score is. First you need to create a method which computes z-score. It requires you to have mean-x and s value before hand. Then, it takes a value which is … ![]() | |
Re: You just copied someone else's script & page? Also, this script is very very very old because you no longer need to check for "document.getElementById" anymore. What you need is to add another function called by your form on submit -- comparision() -- inside the script tag. The syntax of … | |
Re: Sorry, I don't have a server which can run PHP installed in this computer... Also, the file is huge (16kb)! Anyway, from what you said, the automatically adjusted size of display area tends to be from incorrectly nested div elements. Also, if you do not assign an absolute size of … | |
Re: If you are talking about removable drive, it may be difficult because each computer may have different drive letter assigned. Unless you know exactly which drive you are looking for, I am not sure whether or not you can read the file content without IO error. | |
Re: You already have everything there. You need to initiate the class you implement, and then print its data out in order day, month, and year. You need to read Java tutorial for how to implement a simple class before you can go any further because your post shows that you … | |
Re: Give them a unique ID. It wouldn't work because there are multiple elements having the same class name. It is ambiguous to a browser which element should be performed the toggle here. Sorry, I'm not very familiar with JQuery, so I can't show you much in JQuery. | |
Re: Hmm... I am not familiar with JQuery that much, but I have a question about the way you use it. Your li_template is not a DOM element but it is a string, but you are using it as if it is a DOM element? I don't think JQuery would allow … | |
Re: How about using arrays? You could either use 5 of size-3 arrays or 3 of size-5 arrays. | |
Re: @six_sic6 Please do not feel offended here. Anyway You may need to state that your code requires JQuery library or it won't work. Also, I believe that he is asking for combo box, not radio button??? The principle is similar, but it is not exactly the same. @thijscream A sample … | |
Re: Yes. What you want to do is to collide your code from line 14 to 37 into another loop. Just a sample code portion... You may want to modify to whatever way you want... [CODE] for (int i=0; i<100; i++) { // the loop to control how many lottery tickets … | |
Re: There are many ways to do it. One way to do it is as followed: [CODE] // jsctript // expect str to be in date format of 'dd mmm yyyy' function get60DaysAgo(str) { var dateArr = str.split(/\s+/) // break the string at white spaces if (dateArr.length==3) { // simple check, … | |
Re: Depends on how you want to learn it. If you want it with JQuery, google for JQuery. If you want to learn it from raw JavaScript, google Ajax tutorial should get good and useful links. | |
Re: I've been using TinyMCE for a while. You need to have the library on your server side and include the library in the page. Don't forget the configuration in your javascript. Then you need to follow the format of a textarea element and it should automatically shows the editor for … | |
Re: You can make it better by passing in an element ID instead of using global variable. [CODE] <html> <head> <script type="text/javascript"> // do not need langauge="" in the script tag because it is outdated function output(elementID) { var tb1 = document.getElementById(elementID); if (tb1) { // ensure that the element exists … | |
Re: You should be able to. What you need to do is to add 'if-else' statement inside the 'for' loop statement. If you want to check for the 'name' attribute for a HTML element, you cannot access it directly, but you can access it by using "element.getAttribute('name')". For example, in your … | |
![]() | Re: The line 15, you should initiate [code]Node first=null;[/code] Then line 19 should be only if(first==null). Please use 'code' tag provided by the forum. It's very difficult to read your code in plain text. |
Re: Could you give a scenario when the total becomes wrong? Need to know how it happens or it is difficult to look at the code only and determine where the bug is. Also, in your 2nd code portion line 59, if you are going to use 'cnt' variable as integer, … | |
Re: Dealing with File doesn't require UI in graphic. You need to understand how to read/write file. That's all. You can google for "java read write file" and there should be many example for how to read/write file in Java. | |
Re: Yes, but you need to pass in a param of previously selected duedate_id to your newly created @todo in controller. [CODE] # example in controller def new @todo = Todo.new @todo.duedate_id = params[:duedate_id].to_i>0 ? params[:duedate_id].to_i : nil # if duedate_id has a default value, give the default value to the … | |
Re: If you are going to do it in Rails, you don't need to use CGI script to do because you can open and read files on Rails using File class. This script seems to create & render a HTML page for you using 'puts'. |
The End.