jquery adding one parameter to newseltter form
<p>I want to add one more parameter to the form and to check if it is valid or not but I am unable to do it properly...</p>

<p>Original:</p>

<pre><code>newsletterForm: {
        selector: '#newsletter-form',
        init: function() {
            var base = this,
                    container = $(base.selector),
                    url = container.data('target');

            container.submit(function() {
                container.find('.result').load(url, {email: $('#email').val()},
                function() {
                    $(this).fadeIn(200).delay(3000).fadeOut(200);
                });
                return false;
            });

        }
    }
</code></pre>

<p>I was able to add a field in html but I am not able to add it here, here is what I tried:</p>

<pre><code>newsletterForm: {
        selector: '#newsletter-form',
        init: function() {
            var base = this,
                    container = $(base.selector),
                    url = container.data('target');

            container.submit(function() {
                container.find('.result').load(url, {email: $('#email').val()}, {name: $('#name').val()},
                function() {
                    $(this).fadeIn(200).delay(3000).fadeOut(200);
                });
                return false;
            });

        }
    },
</code></pre>

<p>Not sure how to proceed here but I have in php file the following:</p>

<pre><code>if (is_email($email){ // do something}
else{
  echo '&lt;div class="notification-box error"&gt;';
  echo "Please enter a valid email address";
  echo "&lt;/div&gt;";
}
</code></pre>

<p>Which is showed on page if email is not valid, but when I add it for name like</p>

<pre><code>if (is_string($name){ // do something}
else{
  echo '&lt;div class="notification-box error"&gt;';
  echo "Please enter a name";
  echo "&lt;/div&gt;";
}
</code></pre>

<p>If I don't enter name when filling the form, it won't show this message on page.</p>

<p>Can someone help me?</p>

<p>Thanks.</p>

<p>EDIT:</p>

<pre><code>$name = strtolower($_POST['name']);
$email = strtolower($_POST['email']);


if(!is_string($name) || empty($name)){
    echo '&lt;div class="notification-box error"&gt;';
    echo "Please enter name";
    echo "&lt;/div&gt;";
}
</code></pre>