Pregunta

can you please tell me how to validate form which is prepared dynamically using dfom plugin? I used jquery validation but it don't work on chrome. can you please tell me why dform with jquery validation not working in chrome ?.It is working fine in firefox but not with in chrome why ?? Here is http://jsfiddle.net/8bweG/13/?

$("#sform").dform(
 {
  "elements": [
    {
      "html": [
        {
          "html": [
            {
              "type": "number",
              "id": "totalRetryCount",
              "name": "totalRetryCount",
              "required": false,
              "value": 0,
              "tabindex": 1,
              "validate": {
                  "messages": {
                    "number": "Naveen Kanjush hain"
                  }
              }
            }
          ],
          "type": "fieldset",
          "caption": "Total Retry Count"
        },
        {
          "html": [
            {
              "type": "number",
              "id": "totalRepeatCount",
              "name": "totalRepeatCount",
              "required": false,
              "value": 0,
              "tabindex": 2,
              "validate": {
                  "messages": {
                    "number": "Naveen Kanjush hain"
                  }
              }
            }
          ],
          "type": "fieldset",
          "caption": "Total Repeat Count"
        },
        {
          "html": [
            {
              "type": "select",
              "options": {
                "true": "true",
                "false": "false"
              },
              "id": "summaryReportRequired",
              "name": "summaryReportRequired",
              "required": false,
              "value": "true",
              "tabindex": 3,

            }
          ],
          "type": "fieldset",
          "caption": "Summary Report Required"
        },
        {
          "html": [
            {
              "type": "select",
              "options": {
                "ALWAYS": "ALWAYS",
                "ON_SUCCESS": "ON_SUCCESS"
              },
              "id": "postConditionExecution",
              "name": "postConditionExecution",
              "required": false,
              "value": "ON_SUCCESS",
              "tabindex": 4,

            }
          ],
          "type": "fieldset",
          "caption": "Post Condition Execution"
        }
      ],
      "type": "div",
      "class": "inputDiv",
      "caption": "<h3>Configuration Parameters</h3>"
    }
  ],
  "id": "testSuiteConfigurationform",
  "name": "testSuiteConfigurationform",
  "method": "post"
}
);

Problem is that First field of type ="number".User only type number in that .If user type string or character and move to another field it gives error.if you check on firefox this fiddle it is giving validation error .But on chrome and safari same functionality not work. please follow these steps

on first field write "abc" then click below or next field.it gives error front of first field.it is display on firefox but not on chrome

¿Fue útil?

Solución

It is working but you are missing the Submit button.

This is the correct version: http://jsfiddle.net/8bweG/22/

$("#sform").dform({
    "action" : "http://dgg.gg",
    "method" : "get",
  "elements": [
    {
      "html": [
        {
          "html": [
            {
              "type": "number",
              "id": "totalRetryCount",
              "name": "totalRetryCount",
              "required": false,
              "value": 0,
              "tabindex": 1,
              "validate": {
                  "messages": {
                    "number": "Naveen Kanjush hain"
                  }
              }
            }
          ],
          "type": "fieldset",
          "caption": "Total Retry Count"
        },
        {
          "html": [
            {
              "type": "number",
              "id": "totalRepeatCount",
              "name": "totalRepeatCount",
              "required": false,
              "value": 0,
              "tabindex": 2,
              "validate": {
                  "messages": {
                    "number": "Naveen Kanjush hain"
                  }
              }
            }
          ],
          "type": "fieldset",
          "caption": "Total Repeat Count"
        },
        {
          "html": [
            {
              "type": "select",
              "options": {
                "true": "true",
                "false": "false"
              },
              "id": "summaryReportRequired",
              "name": "summaryReportRequired",
              "required": false,
              "value": "true",
              "tabindex": 3,

            }
          ],
          "type": "fieldset",
          "caption": "Summary Report Required"
        },
        {
          "html": [
            {
              "type": "select",
              "options": {
                "ALWAYS": "ALWAYS",
                "ON_SUCCESS": "ON_SUCCESS"
              },
              "id": "postConditionExecution",
              "name": "postConditionExecution",
              "required": false,
              "value": "ON_SUCCESS",
              "tabindex": 4,

            }
          ],
          "type": "fieldset",
          "caption": "Post Condition Execution"
        },
        {
            "html": [
                {
                    "type" : "submit",
                    "value" : "Login"
                }
            ],
            "type": "fieldset",
            "caption": "Go away"
        }
      ],
      "type": "div",
      "class": "inputDiv",
      "caption": "<h3>Configuration Parameters</h3>"
    }
  ],
  "id": "testSuiteConfigurationform",
  "name": "testSuiteConfigurationform",
  "method": "post"
}
);
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top