- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 21
- Posts with Upvotes
- 20
- Upvoting Members
- 16
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
Re: setting the font to the text field should work. Also to center align the text use textfield.setHorizontalAlignment(JTextField.CENTER); Following code might help you, [CODE] import java.awt.Color; import java.awt.Font; import java.awt.*; import java.awt.font.*; import java.io.*; import javax.swing.*; public class TextFieldExample{ public static void main(String[] args) { JFrame frame = new JFrame(); frame.setLayout(null); … | |
Re: There is no way to get the values of the unchecked checkboxes because when a HTML form is submitted the values of checked checkboxes are sent to the server. One workaround would be use hidden input fields for storing all the values [CODE] <input type="hidden" name="chkboxvalues" value="<%=rs2.getString("description") %>"/> [/CODE] and … | |
Re: To use jquery first download the jquery-1.4.1.js file from the link at [url]http://docs.jquery.com/Downloading_jQuery#Current_Release[/url] Copy it in your webapp folder and use it in the <head> section of the web page as [CODE] <SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="jquery-1.4.1.js"></script> [/CODE] Now if you an select element with id "seltest" as, [CODE] <SELECT ID="seltest" … | |
Re: Instead of directly writing the DocumentContainer.innerHTML into the document of the new window, append the style sheet info to the text. Suppose there is 'testStyle' in 'test.css' that is applied to the <div> tag then try this [CODE] var strHtml = "<html>\n<head>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"test.css\">\n</head><body><div style=\"testStyle\">\n" + DocumentContainer.innerHTML + … | |
Re: You can use SWT to open the browser and render the HTML from memory like given in the example at [url]http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet136.java?view=co[/url] You can find more helpful browser related SWT snippets at [url]http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet136.java?view=co[/url] | |
Re: There are many overloaded runReportToPdf() methods for the JasperRunManager object including the one without connection. Go through the JasperRunManager APIs for more details | |
Re: The line [CODE] <input type="hidden" name="varname" value="calledFunction();" />[/CODE] does not assign the value returned from the javascript function to 'varname' but assign the value 'calledFunction();'. Hence you are getting the function name in your jsp. You will have to assign the value to 'varname' at the onclick event of the … | |
Re: In the opened popup window you can read the values of the parent window like, [CODE] window.opener.formname.elemname.value; [/CODE] and then display this value on the pop up page | |
Re: One way can be that you can check if the div that is added dynamically exists or not by getElementById() funtion and than add or remove it. Hope the sample code below helps you, [CODE] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> <SCRIPT LANGUAGE="JavaScript"> … | |
Re: The problem is with the line [CODE] dv.attachEvent("onmouseclick",function(){element_event_onmouseclick();}); [/CODE] because both IE and FF attach events differently via javascript. For solution to this, first check the browser type. A simple though not very powerful way can be [CODE] //detecting the browser version var bname = navigator.appName; var isIE = false; … | |
Re: There are couple of issues with the array manipulations that you are doing. 1] In Museum.java you are reading the input file with the loop, [CODE] for(int w = 0; w < WEEK-1; w++) { for(int d = 0; d < DAY-1; d++) { for(int h = 0; h < … | |
Re: I think the error is because of missing taglib entries in WEB-INF/web.xml file. First verfiy that you have also copied the jakarta-taglibs-standard-1.0.6\tld folder into the WEB-INF Now in web.xml file add the following entries, [code=XML]<taglib> <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> <taglib-location>/WEB-INF/tld/c.tld</taglib-location> </taglib>[/code] | |
Re: At line 43 you are using the for statement as [CODE] for(int j=0;j<serverdata2.length;j++) [/CODE] but the variable 'serverdata2' is set to null at line 22. This is causing the NullPointerException | |
Re: In the code inputs[i].onkeyup = function() { ................. } you assign a function for that handles keyup event. It does the multiplication there. You can add your logic to calculate the grand total there. | |
Re: If the image is stored as blob binary data you cannot display it is using simply the c:out tag. You need to create a servlet which streams the image from the server and call it in img tag as something like <img src="/getImage?petid=${row.petid}" /> Now in the servlet 1. Read … | |
Re: You will require a scheduler like 'quartz' for this purpose. You can find it at [url]http://www.quartz-scheduler.org[/url] along with the related documentation of its usage in a servlet container etc. | |
Re: Opera does not fire the onunload() event when a page is refreshed. I dont think there could be any solution to this as of now | |
Re: Alternatively you can also use this javascript to get all the input elements having name matching a particular regular expression and process on it [CODE] <script language="JavaScript"> <!-- //set the array filter function if it is not present if (!Array.prototype.filter) { Array.prototype.filter = function(fun /*, thisp*/) { var len = … | |
Re: Implicit objects are only visible within the system generated _jspService() method. They are not visible within methods you define yourself in declarations. So you are getting errors with out.write and/Or out.println. We have to pass them to our own method if we wish to use them locally in those functions. … | |
Re: Since you are entering value with a preceding 0, the parseInt(<value>) function takes it as an octal number. Use the parseInt(<value>, <radix>) function instead with radix set to 10 for decimal numbers as shown below, [CODE] var perOfEasyQues = parseInt(document.getElementById("<%=txb_EasyQuesPerc.ClientID%>").value, 10); [/CODE] | |
Re: Try setting the attributes for table as border="0" cellpadding="0" cellspacing="0" This will remove all the borders from the table Then make appropriate changes to above CSS and apply them to rows and columns of the table to give the desired effect | |
Re: There are two select boxes with the name="menu" in the above code snippet. Hence the javascript code at line 3 above, [CODE] if (document.frm.menu.value == "other") { [/CODE] is not working as expected. You can either change the name of the second select box or change the javascript code to … | |
Re: you can use javascript onclick event to set the text to blank. e.g [CODE] .... <input type="text" name="description" value="Description" onclick="this.value='';"> .... [/CODE] | |
Re: Write a javascript function which will accept the above xml as a parameter and than parse the xml using jquery. [CODE] function parseItemXML(itemXML){ $(itemXML).find('item').each(function(){//For each item element in the xml var showDateTxt = $(this).find('showDate').text(); //get the date var showDate = $.datepicker.parseDate( "mm/dd/yy", showDateTxt); //parse the date using the datapicker jquery … | |
Re: ini4j is a good library to work on ini files. You can use following code sample to add a value in the existing ini file, [CODE] //New Ini instance Ini ini = new Ini(); //Load the ini file File file = new File("test.ini"); ini.load(new FileReader(file)); //adds a new value ini.add("Section", … | |
Re: Seems like you have copy-pasted the code in line 5 in date.jsp. [CODE] <jsp:useBean id=“my” scope="request" class=“hi”> [/CODE] If you look properly you will see that the double quotes for attributes 'id' and 'class' are not normal double quotes. Try using normal double quotes as shown in the code given … | |
Re: If you look at the code properly you will notice that at the following block of code,[CODE] else if(reqact=="add"){//add sent atitle="Add"; newlink="Action(" + locid + ",'cancel')"; } [/CODE] The value of atitle is set to 'Add' instead of 'Cancel'. Hence you fell that it is not working :-) | |
Re: It seems that the entries are deleted because the form is submitted to the server even after you click cancel on the confirm box. One of the reason for this could be that the delete button could be of the type submit e.g. <input type="submit" name="Delete"> make the type of … | |
Re: One thing you must always remember while dealing JSP or any server side scripting is that the server side code is executed first at the server than the resulted HTML is sent to the browser. So in the code snippet given above all the java code between <%= %>, and … | |
Re: First in the code posted above there are syntax errors at line 29. Since you are assiging a string to a variable and that string has single quotes you have to escape them correctly as follows, [CODE] newdiv.innerHTML = '<br>Please copy and paste additional information here<input type='textarea' id='mytext''+i+'')>'; [/CODE] Now … |