如何将 link 和文本添加到查询表单中 - 使用 VB 脚本(我认为)

How to add link and text into enquiry form - uses VB Script (I think)

我到处搜索,但找不到任何可以抓住的东西。我正在尝试修改查询表单,我认为它使用 VB 脚本 - 或者至少网页是一个 ASP 文件并使用包含文件来显示和操作查询表单。

我想添加一行文字 - 例如查看我们的隐私政策。 "Privacy Policy" 将 link 编辑为特定的 URL。

我已经能够通过复制已有的内容来修改表单的各个方面 - 然后添加 类 进行样式设置等。为 link 添加一些 HTML 是哪里我卡住了。

这是包含文件中其中一个表单的代码 - 也许有人能指出我需要添加什么,作为将带有 link 的文本插入表单的一种方式.

任何帮助将不胜感激。

谢谢!

'When the object is instantiated
private sub class_initialize()
    'The page that the form will be submitted to
    formDestination = addressPrefix & XXXXWeb1.GetCurrentDomain & XXXXWeb1.GetCurrentURL(true, false)
    'Declare and set requestMethod to the (lowercase) server variable
    requestMethod = lCase(request.serverVariables("request_method"))
end sub

'The contact form
public function displayContactForm()
    'If the request method is equal to post
    if requestMethod = "post" then
        'Create and set the variables to hold the information entered
        dim fullName : fullName = trim(replace(request("fullName"),"'",""))
        dim email : email = trim(request("email"))
        dim cemail: cemail = trim(request("cemail"))
        dim companyName : companyName = trim(replace(request("companyName"),"'",""))
        dim telephone : telephone = trim(request("telephone"))
        dim subject : subject = trim(replace(request("subject"),"'",""))
        dim enquiry : enquiry = trim(request("enquiry"))
        dim newsletter : newsletter = XXXXweb1.tobool(request("newsletter"))
        if cBool(newsletter) then newsletter = "Yes" else newsletter = "No"
        dim userIPAddress : userIPAddress = request.serverVariables("REMOTE_ADDR")

        'Check the information entered by the user
        XXXXWeb1.Validate "name", cStr(fullName), "<li>", "</li>", true
        XXXXWeb1.Validate "email address", cStr(email), "<li>", "</li>", true, true
        XXXXWeb1.Validate "confirm email address", cStr(cemail), "<li>", "</li>", true, true
        XXXXWeb1.Validate "company name", cStr(companyName), "<li>", "</li>", true
        XXXXWeb1.Validate "telephone", cStr(telephone), "<li>", "</li>", true
        XXXXWeb1.Validate "subject", cStr(subject), "<li>", "</li>", true
        XXXXWeb1.Validate "enquiry", cStr(enquiry), "<li>", "</li>", true

        if not XXXXWeb1.CheckReCaptcha() then 
            XXXXWeb1.SetValidateErrorFound(true)
            XXXXWeb1.SetValidateErrorMessage(XXXXWeb1.GetValidateErrorMessage & "<li>The reCAPTCHA text was entered incorrectly, please try again</li>")
        end if

        'If no errors were found
        if not XXXXWeb1.GetValidateErrorFound then
            'Create and set the email message
            dim emailBody : emailBody = "<html>" &_
                "<head>" &_
                    "<meta http-equiv=""Content-Type"" content=""text/html; charset=utf-8"">" &_
                    "<title>Account Request</title>" &_
                "</head>" &_
                "<body>" &_
                    "<h1 style=""font-family:Arial, Helvetica, sans-serif; font-size:22px; margin:0; padding-bottom:4px; color:#0a3d8d"">Contact Us Enquiry</h1>" &_
                    "<p style=""font-family:Arial, Helvetica, sans-serif; font-size:12px; margin-bottom:20px"">The following enquiry form was submitted by <strong>" & fullName & "</strong> at <strong>" & formatDateTime(now) & "</strong></p>" &_
                    "<table border=""0"" cellspacing=""0"" style=""font-family:Arial, Helvetica, sans-serif; font-size:12px;"">" &_
                        "<tr>" &_
                            "<th width=""200"" align=""left"" valign=""top"" bgcolor=""#ffffff"" nowrap scope=""row"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-left:1px solid #b0afaf; border-right:1px solid #b0afaf;"">Name</th>" &_
                            "<td width=""600"" align=""left"" valign=""top"" bgcolor=""#ffffff"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-right:1px solid #b0afaf;"">" & fullName & "</td>" &_
                        "</tr>" &_
                        "<tr>" &_
                            "<th width=""200"" align=""left"" valign=""top"" bgcolor=""#eff6ff"" nowrap scope=""row"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-left:1px solid #b0afaf; border-right:1px solid #b0afaf;"">Email Address</th>" &_
                            "<td width=""600"" align=""left"" valign=""top"" bgcolor=""#eff6ff"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-right:1px solid #b0afaf;"">" & email & "</td>" &_
                        "</tr>" &_                          
                        "<tr>" &_
                            "<th width=""200"" align=""left"" valign=""top"" bgcolor=""#ffffff"" nowrap scope=""row"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-left:1px solid #b0afaf; border-right:1px solid #b0afaf;"">Company Name</th>" &_
                            "<td width=""600"" align=""left"" valign=""top"" bgcolor=""#ffffff"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-right:1px solid #b0afaf;"">" & companyName & "</td>" &_
                        "</tr>" &_                  
                        "<tr>" &_
                            "<th width=""200"" align=""left"" valign=""top"" bgcolor=""#eff6ff"" nowrap scope=""row"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-left:1px solid #b0afaf; border-right:1px solid #b0afaf;"">Telephone Number</th>" &_
                            "<td width=""600"" align=""left"" valign=""top"" bgcolor=""#eff6ff"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-right:1px solid #b0afaf;"">" & telephone & "</td>" &_
                        "</tr>" &_                      
                        "<tr>" &_
                            "<th width=""200"" align=""left"" valign=""top"" bgcolor=""#ffffff"" nowrap scope=""row"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-left:1px solid #b0afaf; border-right:1px solid #b0afaf;"">Subject</th>" &_
                            "<td width=""600"" align=""left"" valign=""top"" bgcolor=""#ffffff"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-right:1px solid #b0afaf;"">" & subject & "</td>" &_
                        "</tr>" &_
                        "<tr>" &_
                            "<th width=""200"" align=""left"" valign=""top"" bgcolor=""#eff6ff"" nowrap scope=""row"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-left:1px solid #b0afaf; border-right:1px solid #b0afaf;"">Enquiry</th>" &_
                            "<td width=""600"" align=""left"" valign=""top"" bgcolor=""#eff6ff"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-right:1px solid #b0afaf;"">" & enquiry & "</td>" &_
                        "</tr>" &_      
                        "<tr>" &_
                            "<th width=""200"" align=""left"" valign=""top"" bgcolor=""#ffffff"" nowrap scope=""row"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-left:1px solid #b0afaf; border-right:1px solid #b0afaf;"">Sign up to newsletter?</th>" &_
                            "<td width=""600"" align=""left"" valign=""top"" bgcolor=""#ffffff"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-right:1px solid #b0afaf;"">" & newsletter & "</td>" &_
                        "</tr>" &_              
                        "<tr>" &_
                            "<th width=""200"" align=""left"" valign=""top"" bgcolor=""#eff6ff"" nowrap scope=""row"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-bottom:1px solid #b0afaf; border-left:1px solid #b0afaf; border-right:1px solid #b0afaf;"">Use IP Address</th>" &_
                            "<td width=""600"" align=""left"" valign=""top"" bgcolor=""#eff6ff"" style=""line-height:15px; padding:7px 6px 5px; border-top:1px solid #b0afaf; border-bottom:1px solid #b0afaf; border-right:1px solid #b0afaf;"">" & userIPAddress & "</td>" &_
                        "</tr>" &_
                    "</table>" &_
                "</body>" &_
            "</html>"                   

            'Email the details
            XXXXWeb1.SendMail application("emailAddress"), email, "Contact Us Enquiry", cstr(emailBody), 1

            'If the newsletter checkbox was clicked Sign the user up to the mailing list
            if newsletter = "Yes" then XXXXWeb1.MailingListAdd "", cStr(fullName), "", "", cStr(email)

            Response.Redirect("http://www.xxxxxxxxxxxxxxxxxx.com/thank-you.asp")

            'Show the success message       
            'displayContactForm = XXXXWeb1.GetHeadingAndText(11, 2, "<h2>", "</h2>", "<div class=""confirmationContainer"">", "</div>")

            'Write the Google converstion tracking code
            'displayContactForm = displayContactForm & XXXXWeb1.GetText(36, 1)      

            'Show the standard contact details
            'displayContactForm = displayContactForm & XXXXWeb1.GetHeadingAndText(11, 3, "<h2>", "</h2>", "<div>", "</div>")
        end if
    end if
    'If the request method is not equal to post or an error has been found
    if requestMethod <> "post" or XXXXWeb1.GetValidateErrorFound then 
        dim newsletterChecked : if XXXXWeb1.ToBool(request("newsletter")) then newsletterChecked = "checked=""checked"""

        displayContactForm = displayContactForm & XXXXWeb1.GetHeadingAndText(11, 1, "<h2>", "</h2>", "<div>", "</div>")

        'If an error has been found
        if XXXXWeb1.GetValidateErrorFound then
            'Display the errors to the user
            displayContactForm = "<div class=""errorContainer clearLeft""><ul>" & XXXXWeb1.GetValidateErrorMessage & "</ul></div>"
        end if

        'Show the contact form
        displayContactForm = displayContactForm & "<form id=""contactForm"" class=""clearAfter"" action=""" & formDestination & """ method=""post"">" &_
                            "<fieldset>" &_
                                "<legend class=""heading5"">Please complete the form below</legend>" &_
                                "<div class=""clearBoth formFieldContainer"">" &_
                                    "<div class=""formFieldLarge"">" &_
                                        "<label for=""fullName"">Name <span>*</span></label>" & vbCRLF &_
                                        "<input type=""text"" id=""fullName"" name=""fullName"" value=""" & fullName & """ />" &_
                                    "</div>" &_
                                    "<div class=""formFieldLarge"">" &_
                                        "<label for=""email"">Email Address <span>*</span></label>" & vbCRLF &_
                                        "<input type=""text"" id=""email"" name=""email"" value=""" & email & """ />" &_
                                    "</div>" &_
                                    "<div class=""formFieldLarge"">" &_
                                        "<label for=""cemail"">Confirm Email Address <span>*</span></label>" & vbCRLF &_
                                        "<input type=""text"" id=""cemail"" name=""cemail"" value=""" & cemail & """ />" &_
                                    "</div>" &_
                                    "<div class=""formFieldLarge"">" &_
                                        "<label for=""companyName"">Company Name <span>*</span></label>" & vbCRLF &_
                                        "<input type=""text"" id=""companyName"" name=""companyName"" value=""" & companyName & """ />" &_
                                    "</div>" &_
                                    "<div class=""formFieldLarge"">" &_
                                        "<label for=""telephone"">Telephone Number <span>*</span></label>" & vbCRLF &_
                                        "<input type=""text"" id=""telephone"" name=""telephone"" value=""" & telephone & """ />" &_
                                    "</div>" &_
                                    "<div class=""formFieldLarge"">" &_
                                        "<label for=""subject"">Subject <span>*</span></label>" & vbCRLF &_
                                        "<input type=""text"" id=""subject"" name=""subject"" value=""" & subject & """ />" &_
                                    "</div>" &_
                                    "<div class=""formFieldLarge"">" &_
                                        "<label for=""enquiry"" class=""textareaLabel"">Comments <span>*</span></label>" & vbCRLF &_
                                        "<textarea id=""enquiry"" name=""enquiry"" rows=""6"" cols=""48"">" & enquiry & "</textarea>" &_
                                    "</div>" &_
                                    "<div class=""formFieldCheckbox"">" &_
                                        "<input type=""checkbox"" id=""newsletter"" name=""newsletter"" value=""true"" " & newsletterChecked & " />" & vbCRLF &_
                                        "<label for=""newsletter"" class=""checkboxLabel"">Sign up to our informative newsletter to receive fantastic offers! </label>" &_
                                    "</div>" &_
                                    XXXXWeb1.WriteRecaptcha() &_
                                    "<button class=""button1 floatRight"" type=""submit"">Send</button>" &_
                                "</div>" &_
                            "</fieldset>" &_
                        "</form>"

        displayContactForm = displayContactForm & XXXXWeb1.GetText(11, 3)
    end if
end function

这个修改怎么样?

             "</div>" &_
             XXXXWeb1.WriteRecaptcha() &_

            "<p style=""text-align: right"">" &_
                "View our <a href=""http://mycompany.com/privacy"">Privacy Policy</a>" &_
            "</p>" &_

            "<button class=""button1 floatRight"" type=""submit"">Send</button>" &_
        "</div>" &_
    "</fieldset>" &_
"</form>"

它在提交按钮上方添加带有 link 的文本(可能仍需要一些样式)

这是你想要的吗?

更新: 删除导致编译错误的评论