Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Shashank Anand

Greenhorn
+ Follow
since Oct 30, 2008
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 Shashank Anand

I have a form that contains two textareas and a button. My onclick="display()" function goes like this:

On clicking the button, contents of first textarea should be copied to second textarea.
But it seems the innerHTML function is not working as nothing is displayed in the textarea. If I just put myDiv.innerHTML="hello"; it is displayed.
Without using innerHTML, if I just type in the first textarea, it is copied to the second textarea.

Please help me as I want to predefine elements that should go into the textarea using javascript.
Shashank.
Hi,

I have a html division which contains elements like table, textarea, division, links inside it. Is there any way to store the whole division as a unit into database?
If not, what is the way out for storing and retriving the division elements?


-Shashank.


I have a mypage.jsp page which contains 2 divisions.
In the first division, I have the following table, contents of which are taken from database:



In the second division, I want to display the contents of the table row which is clicked.
In order to achieve this, please tell me what I should add in the onclick function.

-Shashank.
Hi All,

I have am html table with columns name, age, address etc arranged row-wise. On clicking a row, I want to display the contents of only that row with a welcome message. Please tell me how I can do this.


-Shashank
I tried this:


and in my html code,

It is not working. Any suggestions please.

-Shashank.

Hi,

I have a textarea to enter user comments and a html editor toolbar attached to that. The data entered is saved to database and I can retrieve the text, images,hyperlinks etc. But the newline and paragraph and not recognised. I have to display the comments in a paragraph like:

Do you have any idea how to do it (like we post new topic in this forum and it comes out with linebreak and paragraphs.)

Thanks in advance.
Shashank
You are right.

So far I was trying to display the records from database in a html table. Now I retrieved it in a text area, the format was perfect. So that means the formatted text itself is saved in the database. Do you have any idea if the display is not in a text area, but simply in a paragraph like how to get the formatted text?

Regards,
Shashank
Hi,

I have a column of datatype 'text' in mysql table. I insert text using a textarea in a jsp page, like:

Hi this is Shashank.
Glad to meet you.

Bye.

When I retrieve the data, it comes out like 'Hi this is Shashank. Glad to meet you. Bye.' in a single line. Will anybody please guide me how I can maintain the text format that was put into the database and display it in the same format?

Thanks in advance.
Shashank


Shailesh,

Thank you very much for the help.
Now my code is working.

Regards,
Shashank.
Hi all,

I am a newbie in javascript. I am developing an application where I have an html table displaying the records from the database. Each row has a check box and on clicking it and pressing delete button, the corresponding record gets deleted from the database. What I am trying to do is, when the user selects a record and clicks delete button a confirm window should pop-up asking for confirmation. also, if the user clicks delete without selecting any record, an alert window 'check the records to delete' should appear.
Here are the form tag and javascript code:

//form tag in index.jsp

<form name="del" id="frm" action="DeleteRecord">
<input type="submit" name="sub" value="Delete" onClick="validation();">
</form>

//javascript code in index.jsp


In the above code, the control will be transferred to servlet whatever is the user action. Please help me in modifying above code.

Thanks in advance.


Hi,

I have following code to save an image into a database (msql - datatype blob).

//b.jsp
<%
File f = new File("c:/myfiles/pictures/bird.jpg");
FileInputStream fis = new FileInputStream(f);
//connection code here...
PreparedStatement ps = con.prepareStatement("INSERT INTO mytable (image) VALUES(?)");
ps.setBinaryStream(1, (InputStream) fis, (int) (f.length()));
ps.executeUpdate();
%>
It works and I can retrieve the image as well.
I have another page a.jsp linked to b.jsp with <form> tag.
There is a text field (name=image) in a.jsp. If I type c:/myfiles/pictures/bird.jpg in the text field and try to retrieve it in b.jsp,
the code doesn't work. Anyone please tell me where it went wrong? The code I am using is:
String img=request.getParameter("image");
File f = new File("img");
//same code as above.



Regards,
Shashank


Hi,

I want to know how to provide links to different pages with result got as above (using resultset and stored in arrays), if I am using the above code is a jsp page.



Thanks.
Hi all,

I need to retrieve data from mysql database using jsp and servlets and display it in pages, 5 records per page. And provide for link to next page to display next 5 records. I am using command like SELECT name,date,message FROM my_table ORDER BY date LIMIT 5 OFFSET 5 to display 5 records. Please anyone suggest me how to display the records in pages. I am using netbeans 6.5


Thanks in advance.
Can you please tell me what is wrong with this code which displays only 'hello world' and nothing else?
I am using netbeans version 6.5 and mysql 5.0
mysql is the default database. If I execute 'select firstname from emp_table' using sql editor, it displays the results correctly.


11 years ago
JSP
Hi,

I have a table with columns custname (VARCHAR(20) NOT NULL), orderno (INT NOT NULL). If I use SELECT * FROM table to retrieve data, the data is displayed in the ascending order of custname and then orderno. But I want the data to be displayed in the order of insertion into the table. Will anybody please tell me which query should I use to do this ?

Thanks,
Shashank.