aspose file tools*
The moose likes Struts and the fly likes how to copy the data one form field  to another form field  by using check box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to copy the data one form field  to another form field  by using check box" Watch "how to copy the data one form field  to another form field  by using check box" New topic
Author

how to copy the data one form field to another form field by using check box

raj chopra
Ranch Hand

Joined: Apr 09, 2012
Posts: 60
Hi All,

i have jsp page using html tags within,
now on checking of the check box some of the fields present in the page should be copied to another fields.

i used simple javascript validation when the checkbox is checked, but my page when totaly loaded and runs in local tomcat server, my page page goes blank and its bery diffiult to find whats the problem.
i dentified that if i tried to "name" the field to be copied problem started.
here is my code snippet:



please guide me shoot this problem.


Reagrds,
raj chopra
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

First things first, does the page ever show up? At what point does it "go blank"?

And remove the XML directive from the first line; what's that doing there?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
raj chopra
Ranch Hand

Joined: Apr 09, 2012
Posts: 60
Hi
Bear Bibeault ,

thanks for reply.

Bear Bibeault wrote:First things first, does the page ever show up? At what point does it "go blank"?

And remove the XML directive from the first line; what's that doing there?


well page doesnt show up. as suggested wii remove the xml tag.
all this started when i added name attribute in html:text
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

In that case, problems with a Struts tag should be discussed in the Struts forum. I have moved this post there for you.
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Raj,

Why you have not included any struts tag library?

Regards
Jatan
raj chopra
Ranch Hand

Joined: Apr 09, 2012
Posts: 60
Hi Bear Bibeault ,

Bear Bibeault wrote:In that case, problems with a Struts tag should be discussed in the Struts forum. I have moved this post there for you.


my page do have the struts tag libs, but i didnot copy them earlier in code snippet.also my project involves struts,springs,hibernate.

here below i post my full code for jsp with out removing the xml directive .

raj chopra
Ranch Hand

Joined: Apr 09, 2012
Posts: 60
jatan bhavsar wrote:Hi Raj,

Why you have not included any struts tag library?

Regards
Jatan


Hi jatan,

Thanks for reply,

all the needed taglibs were inluded, complete jsp code was posted above.

Actually i just added a script fun in existing jsp page in my project and few lines of code to add checkbox functionality to copy data in the same jsp to the newly added text fields i created.
I added name attribute to one of existing <html:text> tag (source ) and to newly added <html:text > tag (destination)
so, i believe problem might be around name attribute
raj chopra
Ranch Hand

Joined: Apr 09, 2012
Posts: 60
Hi All,

Problems got solved.

problem was related to using the name attribute.

Solution : here the html:text automatically generates the name of the input type, based on the generated name we can use proceed ahead rather than specifically using the name attribute.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to copy the data one form field to another form field by using check box