Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesValidation Behavior in DNNValidation Behavior in DNN
Previous
 
Next
New Post
6/18/2016 12:53 PM
 
I have 2 questions regarding Validation Behavior in DNN. 

 

We have a simple Contact Form /sub form  and are preventing it from executing a submit due to the rest API that it will be using?  Questions are:

1.  Is there a way to completely remove DNN's default form action "action='\'"?  We are currently  using "return false" in the javascript function.

2.How do you remove the "This is a required field" popup and change the red border thickness?  Tried many recommendations on this, but none work including:

            $("Form").validate({
                errorPlacement: function () {
                    return true;
                }
and modifying the css: 
    .error  {
        color: red;
        border: 1px solid red;
    }
 3.  Using $('#Form').validate().valid() always returns true and causes fields on the form to disappear, validations not to work, and strange behavior.  How does one work around this.  The code is below

 

 

        function SendMessage() {
            if ($('#Form').validate().valid()) {
                //"message passed");
                var params = {
                    eMail: {
                    Name: $('#<%=Name.ClientID%>').val(), ...............
                    }
                    //Rest API Inteface here .......
            }
        }
        else {
            // message not ready;
        }

<div style="max-width: 400px" id="ContactForm">
    <div>
        <p>
            <asp:TextBox runat="server" ID="Name" Name="Name"
                placeholder="First and Last Name" minlength="6" type="text"
                required="true"
                class="form-control"
                onBlur="this.value=CapFirstLetters(CleanData(this.value));" />
        </p>
    </div>
    <div>
        <p>

            <asp:TextBox runat="server" Name="Phone" ID="Phone" placeholder="Phone" type="usphonenumber" required="true" class="form-control" />
        </p>
    </div>
    <div>
        <p>

            <asp:TextBox runat="server" ID="Email" placeholder="email Address" type="email" required="true" class="form-control" />
        </p>
    </div>
    <div>
        <p>
            <asp:TextBox runat="server" ID="Message" placeholder="Message . . .100 Character Minimum"
                class="form-control" Height="150px" TextMode="MultiLine"
                spellcheck="true"
                required="true"
                minlength="65" onBlur="this.value=CleanData(this.value);"
                title="email Message"
                data-toggle="popover"
                data-trigger="focus"
                data-placement="right"
                data-content="Please include a complete description of your question. A minimum of 100 characters is required." />
        </p>
    </div>
    <div style="text-align: right;">
        <button type="submit" class="btn btn-primary" onclick="return SendMessage()">Send</button>
    </div>
</div>

 

 

 


 
New Post
9/15/2016 11:45 AM
 

You're using $('#Form'), while the id is ContactForm....
So first try changing that, and then go from there..

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesValidation Behavior in DNNValidation Behavior in DNN


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out