Home  >  Article  >  CMS Tutorial  >  How to replace Chinese commas and spaces with English commas in the background keywords of Imperial CMS7.0

How to replace Chinese commas and spaces with English commas in the background keywords of Imperial CMS7.0

藏色散人
藏色散人Original
2019-12-10 09:09:542414browse

How to replace Chinese commas and spaces with English commas in the background keywords of Imperial CMS7.0

How to replace Chinese commas and spaces with English commas in the background keywords of Empire CMS7.0?

Function introduction: When adding keywords to an article, replace the entered Chinese commas "," and spaces with English commas "," in real time. It avoids having to manually enter or change to English commas every time. It is more convenient to type spaces.

It is recommended to study "Empire cms tutorial"

Modification method:

Empire CMS background-->System settings-->Manage data table -->News system data table (phome_ecms_news) [Management field] -->special.field [Modify system field]

Replace this sentence in "Input form replaces html code":

The code is as follows:

<input name="keyboard" type="text" size="52" value="<?=stripSlashes($r[keyboard])?>">

Modify it to the following sentence:

The code is as follows:

<input name="keyboard" type="text" size="52" value="<?=stripSlashes($r[keyboard])?>" onkeyup="this.value=this.value.replace(/,/g,&#39;,&#39;).replace(/ /g,&#39;,&#39;);">

The above code realizes the Chinese comma "," in the input keyword and spaces " " are replaced with English commas ",". If you only want to replace Chinese commas, use the following code:

The code is as follows:

onkeyup="ti.value=keyboard.value.replace(/,/g,&#39;,&#39;);"

Or only replace spaces:

The code is as follows:

onkeyup="ti.value=keyboard.value.replace(/ /g,&#39;,&#39;);"

Note: This article only changes the keywords added to the news system data table. You can refer to this method to modify the article system data table or other data tables.

The above is the detailed content of How to replace Chinese commas and spaces with English commas in the background keywords of Imperial CMS7.0. 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