Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!

Kevin Wong

Greenhorn
+ Follow
since Mar 28, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kevin Wong

Hi All

I am wondering if there is a Java function/api I can use to find the current home directory of a ftp client.
I am trying to find a way to find the absolute directory file path of some some files, that are in the ftp client directory.

I am trying to copy these files into a network shared directory using java.

I have been searching the ftp commands and there does not seem to be any relevant ftp command.

Regards
Kevin Wong
8 years ago
Hi All

I want to do 2 things with a html text box.

Further information: I am using IE6 and javascript/html

2 things are
1) How do I automatically highlight the text in the textbox when the page loads but leaves the default value?
But the highlight disappears when I type a value into the input html text.
2) My webpage is being refreshed/resubmitted to the server when I have the cursor in the text box.
How do I stop this?

Some code snippets examples would be great?

Thanks in advance.

Regards
Kevin Wong
Hi Eric

Thank you for your help so far.

I realised that the row is not being deleted from the browser when the value is being found.
That is using the onload event is being run after the page is browser page loaded and so the row cannot be deleted from the browser.
Is my understanding correct, if it is, is there a way to delete the row from the table before or during it is been generated for display.
Hi Eric

This issue is actually a different from my previous post.
Although I am still working on the same program but just a different issue.
That is why I thought I would start a new post.
Hi All

I know the following html is not properly structured, that is should be using CSS and is using deprecated tags.
However it is existing html/javascript code running on a old propriety java developed application with which I do not want to spent too much time fixing.
The issue is how to get out the value from the font element, I want to get the value ROW1COLUMN2 from the html, refer to below.

For example I have the following html and some javascript code.
I am able to get the row data but I want to get the value ROW1COLUMN2 from the font element
Hi Eric

Thanks for your help.
Problem solved and yes the problem was the I should be using a string in
body onload="loaded()"

Hi Eric

Thanks for your help!
I have fixed the logic with the loop as you have mentioned.
But I am still wondering how to delete the row(s) when the value is found in the row.
When exactly would this Javascript be called to compare the value and delete the row,
could you provide a code snippet of where this Javascript could be called to compare values and delete the row?
Is the <body onload="somejavascript"> a good place to place this because I am getting table referencing errors?
Hi Eric

Thanks for your advice.
I was wondering where exactly to call the javascript to compare values and delete rows?

I was thinking I would call it in the <body onload="callJavascriptFunction"> after the table had loaded
but there is a null reference error when referring to the table, most probably the table reference does not exist anymore.
For example I used the following code with the <body onload="loaded(inbox)">

Hi All

The issue being is how not to load a row when a certain value appears in that column's row.
For example, there are 2 rows displayed in a html table:
Row1Column1 Row1Column2
Row2Column1 Row2Column2
When any value in column 2 equals Row2Column2, I do not want to display the row. So in this case only values in row 1 are displayed.
In the following for example I do not want to display row 2 that has the value Row2Column6.

Thanks for your help in advance!

The code is as follows
Hi All

I am still having problems with converting the output from the jsp default html to xml.
Not sure why the jsp is not responding in xml.
<html>
<head>
<title>My REST Service</title>
</head>
<body>
<%
response.setContentType("text/xml");
out.println("<test><test1>The result is 9003888</test1></test>");
%>
</body>
</html>

Thanks in advance
Kevin
11 years ago
JSP
Opps thank you for your help!
11 years ago
JSP
Hi All

I have not done java web programming for 1 year, actually still very junior at it.
Trying to remember how to program jsp's again.

I have a simple jsp to write, that takes simple user text input and then want the jsp to return xml back to browser.
I have a method I would like to use called setContentType but have not been able to use it in the jsp.
I have listed the code below, when I run the jsp from tomcat servlet container, it throws up an error
"The method setContextType(String) is undefined for the type HttpServletResponse"
Not sure why it should throw up the error as setContextType method is from the ServletResponse that is a
super class of HttpServletResponse.
Please help as not sure what the issue is!
<%@ page language="java" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">;
<html>
<head>
<title>My REST Service</title>
</head>
<body>
<%
String req = request.getParameter("studentNumber");
if ( req == null ) {
response.setContextType("text/html");
out.println("<FORM METHOD=POST ACTION=\"studentService.jsp\">");
out.println("Please enter student number:");
out.println("<INPUT TYPE=TEXT NAME=studentNumber SIZE=20><P><INPUT TYPE=SUBMIT>");
out.println("</FORM>");
} else {
response.setContextType("text/xml");
response.setHeader("Cache-Control","no-cache");
out.println("The result is 9003888");
}
%>
</body>
</html>

Thanks in Advance
11 years ago
JSP