Hongmu Notes
Home Program Notes Assign the result of a multiple-selection form submission to a hidden form in EmpireCMS.
Program Notes Empire cms

Assign the result of a multiple-selection form submission to a hidden form in EmpireCMS.

Assign the result of a multiple-selection form submission to a hidden form in EmpireCMS.

In Empire CMS, if you need to implement a multiple-selection feature—such as a multi-select regional search—you must concatenate all the forms generated after the regional selection process and then pass them to the `keyboard` field. For this purpose, the following code can be used:

HTML code snippet:

<label class="area-box-listhover">
    <input class="inputcheckbox" type="checkbox" name="address[]" value="安徽">
    <span class="area-box-name">安徽</span>
</label>
<label class="area-box-listhover">
    <input class="inputcheckbox" type="checkbox" name="address[]" value="澳门">
    <span class="area-box-name">澳门</span>
</label>
<label class="area-box-listhover">
    <input class="inputcheckbox" type="checkbox" name="address[]" value="重庆">
    <span class="area-box-name">重庆</span>
</label>
<label class="area-box-listhover">
    <input class="inputcheckbox" type="checkbox" name="address[]" value="福建">
    <span class="area-box-name">福建</span>
</label>
<label class="area-box-listhover">
    <input class="inputcheckbox" type="checkbox" name="address[]" value="广东">
    <span class="area-box-name">广东</span>
</label>

<input id="hadd" type="hidden" name="keyboard[]"  >

jQuery code:

$(document).ready(function() {
	$('input[name="address[]"]').change(function() {
		// 获取选中的复选框的值
		var address = $('input[name="address[]"]:checked').map(function() {
		return $(this).val();
		}).get().join(' '); // 将选中的复选框的值拼接成字符串,以空格隔开

		// 设置隐藏域的值
		$('input[id="hadd"]').val(address);
	});
	});

 

微信赞赏

WeChat

支付宝赞赏

Alipay

✍️ Author: Hong Mu

webmaster · Thanks for reading, stay tuned for more exciting content

Author homepage View home page →

Related articles

Empire CMS database statement & SQL statement format

Empire CMS database statement & SQL statement format Program Notes Empire cms

Introduction to Imperial CMS extended SQL program writing, basic examples of Imperial CMS database statements & SQL statement formats: Note: The following examples are based on placing PHP files in the system root directory. Example 1: Connect to MYSQL program. (a.php)<?php require('e/class/connect.php'); //Introduce database configuration files and public function files requ…
👁 351
Empire CMS obtains the system COOKIE variable function getcvar()

Empire CMS obtains the system COOKIE variable function getcvar() Program Notes Empire cms

Get the system COOKIE variable function syntax: getcvar($var,$ecms) Description: $var: is the variable name $ecms: 0 is to set the foreground COOKIE variable, 1 is to set the background COOKIE variable. This parameter can be omitted and defaults to 0. Usage example: getcvar('mlusername'), get the user name of the front-end login member getcvar('loginu...
👁 295
Empire CMS smart label call field collection

Empire CMS smart label call field collection Program Notes Empire cms

Collect and classify all fields that support smart tag calls into Empire CMS smart tags: [e:loop={column ID/topic ID, number of items displayed, operation type, only display pictures with titles, additional SQL conditions, display sorting}] Template code content [/e:loop] Calling time: <?=date('m-d',$bqr[newstime])?> <?=dat…
👁 3749

Recommended reading

(Adaptive Mobile Version) Responsive Website Template for Academic Papers, Journals, and Books – 1011

(Adaptive Mobile Version) Responsive Website Template for Academic Papers, Journals, and Books – 1011 Practical Collection pbootcms Template

A responsive PbootCMS website template designed for academic journals and book publications, compatible with both PC and WAP devices. Its professional, academic design makes it ideal for journals and academic publishing platforms to showcase their content and services. This template helps academic publishing institutions build an authoritative online presence and attract both authors and readers. Template Demo | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www.4s5.c...
👁 40
(Adaptive mobile version) Responsive tea ceremony article-based website PBootCMS template; Download source code for news and knowledge-based websites – 0310

(Adaptive mobile version) Responsive tea ceremony article-based website PBootCMS template; Download source code for news and knowledge-based websites – 0310 Practical Collection pbootcms Template

This is an adaptive, responsive PbootCMS website template designed for showcasing tea culture, tea ceremony knowledge, and industry news for mobile devices. Its classical and elegant design makes it ideal for sharing tea culture, tea ceremony insights, and industry updates. It enables tea brands or tea culture enthusiasts to promote the aesthetics of the tea ceremony online. Template Preview | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www.4s5.cn | Related Articles...
👁 50
A PHP function that adds or subtracts a specified amount of time from a timestamp and returns the result in a specified format.

A PHP function that adds or subtracts a specified amount of time from a timestamp and returns the result in a specified format. Language Notes PHP PHP and mysql

Here is a PHP function that adds or subtracts a specified amount of time from a timestamp and then outputs the resulting time in a specified format: <?php /** * Adds or subtracts a specified amount of time from a timestamp and outputs the resulting time in a specified format * * @param string $time-Date-time string in the format 'Y-m-d H:i:s' * @param int $seconds-The amount of time to add...
👁 148
Acupuncture

Acupuncture Hobbies Memo notes

I really vomited. I took notes for a long time and forgot to save them. I had a headache. It was @#¥%... Shao Shan Huo (Qi Intake Method): If you want to treat long-term paralysis, persistent numbness and cold numbness, traveling pain all over the body, leprosy, wind, cold and malaria, all cold symptoms, first use shallow needle insertion...
👁 225
Knowledge-based paid video course website template – 28652 | 0555

Knowledge-based paid video course website template – 28652 | 0555 Practical Collection Yiyou template

This professional EyouCMS template is ideal for knowledge-based paid services and video course purchases. Its knowledge-centric design enables effective display of video courses, paid articles, membership plans, and purchase workflows, helping content creators build online knowledge-based payment platforms. Template Demo | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS (Ey...
👁 60
(Adaptive Mobile Version) Smart Phone AI Robot Voice Software Website Template – 1012

(Adaptive Mobile Version) Smart Phone AI Robot Voice Software Website Template – 1012 Practical Collection pbootcms Template

PbootCMS website template – an AI-powered smartphone robot voice software solution compatible with both PC and WAP devices. Its cutting-edge design is ideal for showcasing AI voice products, smartphone robots, and technical solutions. This template helps technology companies present their innovative products online, attracting investors and customers. Template Overview | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www.4...
👁 51