Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem in creating dynamic form...also, is it possible to add the fields from JAVASCRIPT directly to the database using JSP?...

Reply
Thread Tools

Problem in creating dynamic form...also, is it possible to add the fields from JAVASCRIPT directly to the database using JSP?...

 
 
Jagdeesh
Guest
Posts: n/a
 
      09-26-2003
Hello everyone,

I am using JSP with javascript for my application. I am a new user of
this field. I am creating a dynamic project entry form as written
below. I have a button named "ADD MORE PROJECT DETAILS". When i click
that button, it must create another project column(projectname2 and
status2). When again clicked it must create another
column(projectname3 and status3) and so on, without interrupting the
previous project columns.

I have written a script for that, but unfortunately the column is
being overwritten when i click the ADD MORE PROJECT DETAILS button.
Pls. take a look of my file and tell me whats wrong or what must be
used. Also, tell me whether i can add all these details from the
javascript to the database(POSTGRESQL) as in the case of JSP.

MY JSP FILE:

//.........................blah blah
blah...............................

out.print("<tr>\n <td>Project Name 1</td><td style=\" border-width:
1\">");
out.print("<textarea name=\"projectname\" cols=\"70\"
rows=\"2\"></textarea>");
out.println("</td>\n </tr>");

out.print(" <tr>\n<td>Project Status 1</td><td style=\"border-width:
1\">");
out.print("<textarea name=\"status1\" cols=\"70\"
rows=\"2\"></textarea> ");
out.println("</td>\n </tr>");

// ................................................Ad ditional fields
..............................

out.print("<tr><td style=\"text-align: Center; colspan=\"2\"><input
type=\"button\" value=\"Add more Project details\"
onClick=\"javascript:addmore();\"></td>\n </tr>");

out.print("<tr><td>");
out.print("<span id=cust1 style=\"position:relative;\"></span>");
out.println("</td>\n </tr>");

out.print("<tr><td>");
out.print("<span id=cust2 style=\"position:relative;\"></span>");
out.println("</td>\n </tr>");

// ........................then i have the SUBMIT BUTTON
.........................


MY JAVASCRIPT IS:

<script Language="JavaScript">

var num=1;
function addmore() {

num++;

data1 = "<font style='font-size: 11pt; color:
#00000'>Projectname"+num+"</font>";
data2 = "<textarea name='projectname"+num+"' cols='70'
rows='2'></textarea>";
data3 = "<font style='font-size: 11pt; color: #00000'>ProjectStatus
"+num+"</font>";
data4 = "<textarea name='status"+num+"' cols='70'
rows='2'></textarea>";

cust1.innerHTML = data1;
cust2.innerHTML = data2;
cust3.innerHTML = data3;
cust4.innerHTML = data4;
}
</script>


It would be great if you can suggest your views as soon as possible..

Thanx for spending your valuable time.

Cheers,
Jagdeesh.
 
Reply With Quote
 
 
 
 
Sudsy
Guest
Posts: n/a
 
      09-26-2003
Jagdeesh wrote:
> Hello everyone,


I just love these kinds of posts! Here's someone who's getting paid to
develop an application. Rather than making the effort to understand
the technology or even reducing the problem to the essentials, they
post their code here and expect someone to correct it FOR FREE!

> It would be great if you can suggest your views as soon as possible..


And now it's a rush job too!

> Thanx for spending your valuable time.


If time is valuable then it would be worth paying for, no? Pay me
US$65/hr and I'll happily debug and finish your code.

> Cheers,
> Jagdeesh.


 
Reply With Quote
 
 
 
 
Jagdeesh
Guest
Posts: n/a
 
      09-28-2003
Hello Mr.Sudsy,

> Rather than making the effort to understand
> the technology or even reducing the problem to the essentials, they
> post their code here and expect someone to correct it FOR FREE!


Excuse me Gentleman - I posted the coding because everyone might get
an OVERVIEW of my problem. i have asked only your views or
suggestions. I HAVEN'T ASKED YOU TO CORRECT MY CODING AND GIVE IT TO
ME. I HAVE ASKED MY DOUBT IN A VERY POLITE MANNER, NOT LIKE YOU. Learn
how to behave decently.

> I just love these kinds of posts! Here's someone who's getting paid to
> develop an application.


Have you read my doubt fully????....I am not asking you to develop an
application. Hereafter, Read the question completely and post your
thoughts.

> Pay me US$65/hr and I'll happily debug and finish your code.


F4 Y3! ..Since i don't want to waste more time for replying to such
posts, I stop with this.

Finally, I found the error in my part. It is:

cust1.innerHTML += data1;
cust2.innerHTML += data2;
cust3.innerHTML += data3;
cust4.innerHTML += data4; instead of,

cust1.innerHTML = data1;
cust2.innerHTML = data2;
cust3.innerHTML = data3;
cust4.innerHTML = data4;

cheers,
Jagdeesh.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
epydoc: How to add new fields as the building fields? Cyril.Liu Python 0 12-02-2008 05:01 AM
possible to allow a user to type directly into a dropdown list to add new item? Dica ASP .Net 4 11-09-2005 02:43 PM
Preview image directly on PC, save directly to HD Patrick M. Digital Photography 3 01-07-2004 08:29 PM
Problem in creating dynamic form...also, is it possible to add the fields from JAVASCRIPT directly to the database using JSP?... Jagdeesh Javascript 0 09-26-2003 04:10 AM



Advertisments