Solved

This should be a simple question regarding a carriage return

Posted on 2004-04-20
13
509 Views
Last Modified: 2006-11-17
I've got a textarea in this JSP and when I submit the page to another JSP, the query string doesn't contain the carriage returns that were in the textarea. How can I make it so they are passed into the query string? BTW I'm basically using the java to submit the page and using the txtarea.value when creating the query string if that helps any.
0
Comment
Question by:j_coreil
  • 7
  • 6
13 Comments
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10871900
you are doing a GET, Try doing a post instead
0
 
LVL 2

Author Comment

by:j_coreil
ID: 10872035
I'm not using forms.
0
 
LVL 2

Author Comment

by:j_coreil
ID: 10872056
I'm using javascript to submit:

<SCRIPT language=javascript>
      function infocheck()
      {          
        if (from.value == "") {
          //alert("From is a required field . . . ");
          from.value = "N/A";
          //from.focus();
          }
        if (subject.value == "") {
          //alert("Subject is a required field . . . ");
          subject.value = "N/A";
          //subject.focus();
          }
        if (longDesc.value == "") {
          alert("Long description is a required field . . . ");
          longDesc.focus();
            return;}  
        document.location.href='emailsubmit.jsp?username=<%=username%>&topic=<%=topic%>&BU=<%=BU%>&shortDesc=<%=shortDesc%>&BusinessCritical=<%=BusinessCritical%>&longDesc='+longDesc.value+'&subject='+subject.value+'&from='+from.value;
        return;
      }      
</SCRIPT>
0
 
LVL 19

Accepted Solution

by:
Kuldeepchaturvedi earned 80 total points
ID: 10872097
change this to
document.location.href='emailsubmit.jsp?username=<%=username%>&topic=<%=topic%>&BU=<%=BU%>&shortDesc=<%=shortDesc%>&BusinessCritical=<%=BusinessCritical%>&longDesc='+escape(longDesc.value)+'&subject='+escape(subject.value)+'&from='+escape(from.value);
        return;
0
 
LVL 2

Author Comment

by:j_coreil
ID: 10872133
Will try. What will this do?
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10872142
it will convert the carrige feeds to there escape characters so that it can be passed on the URL
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Author Comment

by:j_coreil
ID: 10872169
Do I need to worry about wrap being set on the textarea?
0
 
LVL 2

Author Comment

by:j_coreil
ID: 10872183
Didn't work, it still just put the values side by side as if the white space is being taken out.
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10872201
Hmm... that should have worked....
check what its putting in the browser URL and paste it here
0
 
LVL 2

Author Comment

by:j_coreil
ID: 10872339
http://ss01as01:7778/ticket/admindetailticketsubmit.jsp?ticket_id=200404.020443&username=JCOREIL&PRIORITY=Medium&TOPIC=EMAIL&ASSIGNED=JCOREIL¬e=This%20%0D%0A%0D%0AIs%0D%0A%0D%0AA%0D%0A%0D%0ATest


Before it wasn't putting the %20%0D%0A%0D%0A, I am guessing %20 = space, %0D = new line, %0A = carriage return. What do I do from here?
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10872376
yeah thats correct, it does converts your special characters to the UTF encodes, now rest of it is HTML's job..

now how you are getting this values to display back in the test area... show me that code...
0
 
LVL 2

Author Comment

by:j_coreil
ID: 10872411
It works, I had something wrong. Thank you for your help.
0
 
LVL 19

Expert Comment

by:Kuldeepchaturvedi
ID: 10872462
don't forget to accept the answer..:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
nested if has else if 13 92
own marker interface 1 50
Using Tomcat as raspberry pi java app server 13 141
Books that can get me started on JAVA 2 82
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now