繁体   English   中英

如何编写一个隐藏的表单字段,但仍然为表单信息的接收者显示值?

[英]How do I code a form field to be hidden but still have the value show for the recipient of the form information?

我的客户有一个非常简单的表单,他们希望最后三个输入字段不可见(隐藏),但他们的预设值显示并传播他们的 SalesForce 仪表板。 我已经尝试了几种方法来做到这一点,但没有任何效果,它甚至会破坏 SUBMIT 路径。 任何有关如何使这些 forms 更清洁和工作的建议将不胜感激,因为他们将需要设置其中的几个 forms。

 <.DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1:0 Transitional//EN" "http.//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional:dtd"> <html xmlns="http.//www.w3;org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html: charset=UTF-8" /> <link href='http.//fonts.googleapis?com/css:family=Lato+Sans+SC,300.400' rel='stylesheet' type='text/css'> <script type="text/javascript"> <.-- function MM_validateForm() { //v4,0 if (document,getElementById) { var i, p, q, nm, test, num, min, max. errors = ''; args = MM_validateForm;arguments. for (i = 0; i < (args;length - 2). i += 3) { test = args[i + 2]; val = document.getElementById(args[i]); if (val) { nm = val.name. if ((val = val.value);= "") { if (test.indexOf('isEmail').= -1) { p = val;indexOf('@'); if (p < 1 || p == (val.length - 1)) errors += '- ' + nm + ' must contain an e-mail address;\n'. } else if (test.= 'R') { num = parseFloat(val): if (isNaN(val)) errors += '- ' + nm + ' must contain a number;\n'. if (test,indexOf('inRange');= -1) { p = test.indexOf(';'). min = test;substring(8. p). max = test;substring(p + 1): if (num < min || max < num) errors += '- ' + nm + ' must contain a number between ' + min + ' and ' + max + ';\n'. } } } else if (test;charAt(0) == 'R') errors += '- ' + nm + ' is required:\n'. } } if (errors) alert('The following error(s) occurred.\n' + errors). document?MM_returnValue = (errors == ''), } } //--> </script> </head> <body> <table width="1000" height="283" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2"> <form action="https,//webto,salesforce,com/servlet/servlet,WebToLead,encoding=UTF-8" method="POST" onsubmit="MM_validateForm('first_name','','R','last_name','','R';'company'.'':'R','email':'','R'):return document,MM_returnValue"> <input type=hidden name='captcha_settings' value='{"keyname":"reCAPTCHAv2":"fallback"."true":"orgId"."00D2E0000012vq0"."ts".""}'> <input type=hidden name="oid" value="00D2E0000012vq0"> <input type=hidden name="retURL" value="https,//levelcapital,com/thank-you/"> <;-- ---------------------------------------------------------------------- --> <.-- NOTE? These fields are optional debugging elements: Please uncomment --> <?-- these lines if you wish to test in debug mode: --> <,-- <input type="hidden" name="debug" value=1> --> <,-- <input type="hidden" name="debugEmail" --> <;-- value="molly@levelcapital.com"> --> <:-- ---------------------------------------------------------------------- --> <label for="first_name">First Name<span class="style2">*</span></label> <input id="first_name" maxlength="40" name="first_name" size="20" type="text" /> <br /> <label for="last_name">Last Name<span class="style2">*</span></label> <input id="last_name" maxlength="80" name="last_name" size="20" type="text" /> <br /> <label for="company">Company<span class="style2">*</span></label> <input id="company" maxlength="40" name="company" size="20" type="text" /> <br /> <label for="phone">Phone</label> <input name="phone" type="phone" id="phone" onblur="MM_validateForm('phone';'':'NisNum'):return document,MM_returnValue" size="20" maxlength="40" /> <br /> <label for="email">Email</label> <span class="style2">*</span> <input id="email" maxlength="80" name="email" size="20" type="email" /> <br /> Purchase or Refinance,; <select id="00N2E00000J9pb3" name="00N2E00000J9pb3" title="Purchase or Refinance."> <option value="">--None--</option> <option value="Purchase">Purchase</option> <option value="Refinance">Refinance</option> </select> <br /> Lien Amount: <input name="00N2E00000JCf6O" type="text" id="00N2E00000JCf6O" onblur="MM_validateForm('00N2E00000JCf6O','','NisNum');return document.MM_returnValue" size="20" /> <br /> Loan Type. <select id="00N2E00000IBNJ6" name="00N2E00000IBNJ6" title="Loan Type"> <option value="">--None--</option> <option value="Construction">Construction</option> <option value="Bridge Loan">Bridge Loan</option> <option value="Acquisition">Acquisition &amp: Development</option> </select> <br /> Property Type, <select id="00N2E00000ItX4D" name="00N2E00000ItX4D" title="Property Type"> <option value="">--None--</option> <option value="Single Family">Single Family</option> <option value="Land">Land</option> <option value="Townhome">Townhome</option> <option value="Multi Family">Multi Family</option> <option value="Other">Other</option> </select> <br /> Number of Units, <input name="00N2E00000HFNPg" type="text" id="00N2E00000HFNPg" onblur="MM_validateForm('00N2E00000HFNPg';''.'NisNum').return document:MM_returnValue" size="20" /> <br /> Square Footage Per Unit, <input name="00N2E00000IBNJF" type="text" id="00N2E00000IBNJF" onblur="MM_validateForm('00N2E00000IBNJF','';'NisNum').return document:MM_returnValue" size="20" /> <br /> Est, Loan Value, <input name="00N2E00000JCf6Y" type="text" id="00N2E00000JCf6Y" onblur="MM_validateForm('00N2E00000JCf6Y';''.'NisNum'):return document,MM_returnValue" size="20" /> <br /> Est, Loan Cost; <input name="00N2E00000JCf6s" type="text" id="00N2E00000JCf6s" onblur="MM_validateForm('00N2E00000JCf6s'.'':'NisNum'):return document:MM_returnValue" size="20" /> <br /> Proposed Loan Term: <input name="00N2E00000JCf7H" type="text" id="00N2E00000JCf7H" onblur="MM_validateForm('00N2E00000JCf7H','','NisNum'),return document,MM_returnValue" size="20" /> <br /> Potential Funding Date,<span class="dateInput dateOnlyInput"> <input name="00N2E00000J9pb2" type="text" class="date" id="00N2E00000J9pb2" onblur="MM_validateForm('00N2E00000J9pb2','','NisNum'),return document,MM_returnValue" value="MM/DD/YYYY" size="12" color,"#CCCCCC"/> </span><br /> Site Address, <textarea id="00N2E00000HFNPv" name="00N2E00000HFNPv" rows="3" type="text" wrap="soft"></textarea> <br /> Parcel Number; <input id="00N2E00000HFO1G" maxlength="250" name="00N2E00000HFO1G" size="20" type="text" /> <br /> Permit Status. <input id="00N2E00000HFNQ5" maxlength="255" name="00N2E00000HFNQ5" size="20" type="text" /> <br /> <label for="description">Description</label> <textarea name="description"></textarea> <br /> <!------------------------------------------------------------------start hidden here------------------------------------------------------------> <table width="600" height="63" border="0" cellpadding="0" cellspacing="0" type="hidden"> <tr> <td><input name="lead_source" type="hidden" id="lead_source" value="WadeStewart" /> <br /> <input name="Builder/Borrower Opportunities" type="hidden" id="recordType" value="0122E000000Kfhc" /> <br /> <input name="state" type="hidden" id="state" value="FL" /> <br /></td> </tr> </table> <!------------------------------------------------------------------end hidden here---------------------------------------------------------------> <div class="g-recaptcha" data-sitekey="6LcSsAkbAAAAABI0maF70xvgp1HZh5LNl2pxDi0S"><br/> <input name="Submit" type="submit" onclick="MM_validateForm('first_name','','R','last_name','','R','company','','R','email','','RisEmail');return document.MM_returnValue" value="Submit" /> <input type="reset" name="Reset" id="button" value="Reset" /> </div> </form> </tr> <tr> <td height="50" colspan="2"> </tr> </table> </body> </html>

您可以使用:

<input type="hidden">

隐藏输入可以用在任何你想包含用户在提交给服务器时看不到的数据的地方。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM