• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 519
  • Last Modified:

This should be a simple question regarding a carriage return

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
j_coreil
Asked:
j_coreil
  • 7
  • 6
1 Solution
 
KuldeepchaturvediCommented:
you are doing a GET, Try doing a post instead
0
 
j_coreilAuthor Commented:
I'm not using forms.
0
 
j_coreilAuthor Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
KuldeepchaturvediCommented:
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
 
j_coreilAuthor Commented:
Will try. What will this do?
0
 
KuldeepchaturvediCommented:
it will convert the carrige feeds to there escape characters so that it can be passed on the URL
0
 
j_coreilAuthor Commented:
Do I need to worry about wrap being set on the textarea?
0
 
j_coreilAuthor Commented:
Didn't work, it still just put the values side by side as if the white space is being taken out.
0
 
KuldeepchaturvediCommented:
Hmm... that should have worked....
check what its putting in the browser URL and paste it here
0
 
j_coreilAuthor Commented:
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
 
KuldeepchaturvediCommented:
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
 
j_coreilAuthor Commented:
It works, I had something wrong. Thank you for your help.
0
 
KuldeepchaturvediCommented:
don't forget to accept the answer..:-)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now