如何以可填写的形式获取三个字段并将它们合并为一个字段 [英] How do I take three fields in a fillable form and combine them into one
问题描述
我有三个字段名字,中间名和姓氏。我想把这三个字段合并到第二页上,要求打印他们的名字。
我尝试了什么:
使用此脚本
//获取字段值,作为字符串
var s1 = getField (母亲名字).valueAsString;
var s2 = getField(母亲中间名).valueAsString;
var s3 = getField(姓氏母亲) ).valueAsString;
//合并值,用空格分隔
event.value = s1 ++ s2 ++ s3;
I have three fields First Name, Middle Name and Last Name. I would like to take these three fields and combine them on a second page where there are asked to print their name.
What I have tried:
using this script
// Get the field values, as strings
var s1 = getField("Mother First Name").valueAsString;
var s2 = getField("Mother Middle Name").valueAsString;
var s3 = getField("Mother Last Name").valueAsString;
// Combine values, separated by a space
event.value = s1 + " " + s2+ " " +s3;
推荐答案
您的问题不是关于如何连接字符串,而是如何将表单数据提交到另一个页面以便使用JavaScript进行显示。学习 HTML5初学者指南& CSS3 - 带有HTML5的强大表格 [ ^ ]。
Your issue is not about how to concatenate strings, rather how to submit form data to another page for display using JavaScript. Learn Beginner's Guide to HTML5 & CSS3 - Formidable Forms with HTML5[^].
这篇关于如何以可填写的形式获取三个字段并将它们合并为一个字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!