0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Pardot FormでJava Scriptを使った検証ルールを書く

Last updated at Posted at 2022-07-26

Pordotの質問と回答をまとめ

無料のPardotの環境がないので確かめることはできませんが、仮想でコードを組み立てることはできそうです。
--> 単純にWEBサーバーを使ってHTMLを作れば検証はできるように思います。うまくすれば私でも回答できる範囲を広げることができるかもしれません。ただのJava ScriptでPardotの技術でない。

Javascript Form Validation to be written in thank you code

フィールドのAPI名はわかんないので想像で答えています。

<script>
    window.addEventListener("load", function () {
        var firstname = document.querySelector(".First name input");
        var lastname = document.querySelector(".Last name input");
        var element = document.querySelector(".First name div");
        firstname.onkeyup = function (e) {
            if (firstname.value == lastname.value ) {
                element.innerHTML = "<p class='error'>error </p>";
                element.style.display = "block";
            }

        var Email = document.querySelector(".Email input");
        var element2 = document.querySelector(".First name div");
        var Emailstr = Email.value;
        var check1 = Emailstr.includes(firstname.value);
        var check2 = Emailstr.includes(lastname.value);

        Email.onkeyup = function (e) {
            if (check1 && check2 ) {
                element2.innerHTML = "<p class='error'>error </p>";
                element2.style.display = "block";
            }
   

        };
        
    });        
</script>

関連資料

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?