Home >CMS Tutorial >DEDECMS >How to automatically replace Chinese commas with English commas in DreamWeaver

How to automatically replace Chinese commas with English commas in DreamWeaver

藏色散人
藏色散人Original
2020-01-04 09:17:222483browse

How to automatically replace Chinese commas with English commas in DreamWeaver

How to automatically replace Chinese commas in Dreamweaver with English commas?

When DEDECMS publishes documents and enters tags, Chinese commas are automatically replaced with English commas

Recommended learning: Dreamcms

Starting from version 5.3 of DedeCms, the spacer of the TAG tag has been changed from a space to an English comma. This makes it very inconvenient for webmaster friends who often create original articles, because we are Chinese and we like to use Chinese when entering Chinese characters. comma, is there any way to automatically change the comma when entering a tag into an English comma? Finally I found a method, and now I share it with you. The method is as follows:

The following is the modification method for DEDE5.5 and 5.6:

Open dede/templets/article_add .htm file, and then look for the following code:

<input name="tags" type="text" id="tags" value="" style="width:300px" />

and change it to:

<input name="tags" type="text" id="tags" value="" 
onkeyup="this.value=this.value.replace(/,/g, &#39;,&#39;); " style="width:300px" />

This way, it’s fine. Note that the above only changes the automatic comma switching of tags for adding new articles. If you want to change the tags for editing articles, adding new software, etc., then find the corresponding template and modify it as mentioned above.

The following is the modification method for DEDE5.7:

Open the dede/templets/article_add.htm file, and then find the following code:

<input name="tags" type="text" id="tags" value="" style="width:300px" 
onChange="$Obj(&#39;keywords&#39;).value=this.value;" />

Modify For:

<input name="tags" type="text" id="tags" value="" style="width:300px"
 onkeyup="this.value=this.value.replace(/,/g, &#39;,&#39;); $Obj(&#39;keywords&#39;).value=this.value;" />

I have personally tested the above code and it is correct, please feel free to use it!

The above is the detailed content of How to automatically replace Chinese commas with English commas in DreamWeaver. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn