Use inputtype = textvalue = str value incomplete solution _ HTML/Xhtml _ webpage Creation

Source: Internet
Author: User
When you want to obtain formatted data, you can only obtain the value on "XXXX, XX, XX" in the value method. The solution for "week X" in the future is as follows, if you are interested, refer to the following code for a very strange problem today:
SimpleDateFormat dateFormat = new SimpleDa

The Code is as follows:

TeFormat ("MM dd, yyyy ");
String date = dateFormat. format (new Date ());


It is intended to print out the week X of XXXX Year XX month XX day
The problem lies in the following code. When I want to obtain formatted data, when the value = method value is used, I can only get "XXXX, XX, XX ", the next "week X" cannot be obtained

The Code is as follows:




Disabled/>



① Later I thought it could be an HTML Escape problem, so I removed all the spaces in "yyyy MM dd E, the result can be set to "yyyy-MM-dd-E"
② There is also a way to replace the content of the strings to be displayed one by one using escape characters.

The Code is as follows:


<%
String result = "";
For (int I = 0; I <date. length (); I ++ ){
Switch (date. charAt (I )){
Case '<':
Result + = "<";
Break;
Case '> ':
Result + = "> ";
Break;
Case '&':
Result + = "&";
Break;
Case '"':
Result + = "\"";
Break;
Case '\'':
Result + = "'";
Break;
Case '':
Result + = "";
Break;
Default:
Result + = date. charAt (I );
}
}
%>


The reference content is as follows::
HTML original code display result description
<Less than sign or display mark
> Greater than signs or display tags
& Can be used to display other special characters
"" Quotation marks
®®Registered
©©Copyright
™™Trademark
Half a blank space
  A blank space
Blank rows

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.