Processing of the disappearance of the (textarea) carriage return line break when a request (URL) is submitted, textarea carriage return line break

Source: Internet
Author: User

Processing of the disappearance of the (textarea) carriage return line break when a request (URL) is submitted, textarea carriage return line break

About the processing that the (textarea) carriage return line break disappears when the request (URL) is submitted. Sometimes, when we enter a query on the page, we want to query multiple at the same time. Then, press enter to separate the content of each query.

The background can only receive strings without the carriage return line break.

One of the following requests

Window. location = "$ {ctx}/post/cusQueryMailExport? CustomerId = "+ customerId +" & postTimeStart = "+ postTimeStart +" & postTimeEnd = "+ postTimeEnd +" & mailNo = "+ mailNo;

If mailNo is a bar code separated by carriage return, the bar code will only be a string at the background, and the line break is removed by default. However, if the form is submitted, the line break is retained.

Therefore, when you submit a request, process it first.

Var mailNo = $ ("# mailNo "). val (). replace (/[\ r \ n]/g, ","); // replace the carriage return ","

In this way, the backend can be separated by commas.

String [] mails = paramMap. get ("mailNo"). toString (). trim (). split (","); // when exporting,


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.