Topic
  • 3 replies
  • Latest Post - ‏2013-10-03T14:27:13Z by mburati
umashanker
umashanker
2 Posts

Pinned topic Client side validation using Java Script in portlet factory

‏2010-04-22T05:59:47Z |
I am using WPF for dveleoping portlet. I am developing a page where there are fields on page name, email etc. some are mandatory fields too. I want to perform client side validation using java script. once the validation are correct I want to submit form and call an action. Can any body help how to perform client validation using java script and then call the submit action on clicking the submit button.
Updated on 2010-04-22T11:37:36Z at 2010-04-22T11:37:36Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    9029 Posts

    Re: Client side validation using Java Script in portlet factory

    ‏2010-04-22T11:37:36Z  
    One easy way to do this is to attach your validation script to the form element as an onsubmit event handler, and return false from your code if the validation fails. You can then use normal WPF actions to submit the form, and rely on the validation logic to cancel the submit if something's wrong in the form. Note that for security reasons, you'll also want to validate on the server.
  • Abhishek_Tec
    Abhishek_Tec
    12 Posts

    Re: Client side validation using Java Script in portlet factory

    ‏2013-10-03T09:38:47Z  
    One easy way to do this is to attach your validation script to the form element as an onsubmit event handler, and return false from your code if the validation fails. You can then use normal WPF actions to submit the form, and rely on the validation logic to cancel the submit if something's wrong in the form. Note that for security reasons, you'll also want to validate on the server.

    Hi

    i hav one form page.in this page 9 fields are available.Validation is working for all fields but Mobile No Field ,it is not working,i hav used Phone Number format For Mobile No validation .it accept all character and Number Also,after clicking Submit Button.(Server Side Validation).But Mobile No contain 10 digits.so how it will work?

     

    please help me..

    Updated on 2013-10-03T09:40:31Z at 2013-10-03T09:40:31Z by Abhishek_Tec
  • mburati
    mburati
    2576 Posts

    Re: Client side validation using Java Script in portlet factory

    ‏2013-10-03T14:27:13Z  

    Hi

    i hav one form page.in this page 9 fields are available.Validation is working for all fields but Mobile No Field ,it is not working,i hav used Phone Number format For Mobile No validation .it accept all character and Number Also,after clicking Submit Button.(Server Side Validation).But Mobile No contain 10 digits.so how it will work?

     

    please help me..

    Some WEF validation (in particular client side validation, as opposed to server side validation) is done via the validation support provided by Dojo input widgets.

    Since many mobile phones / networks are significantly slower than wired and wifi networks, the mobile theme by default tries to significantly reduce the size and amount of http requests required to render the application, and Dojo is large and often requires multiple requests, so it is not enabled by default in the Mobile theme.     Another reason the WEF Dojo RDD is not the default for the mobile theme is that it was found that the Dojo date picker was not working well on mobile devices.

    The "Theme" typically specifies which Rich Data Definition (RDD) file to use by default.   If you look in your Application Tree in the Designer for your generated webapp, you'll see that the theme likely specifies a base mobile rdd when you apply the smarphone or tablet profile.   If you switch it to default or browser applied profile, you'll likely see it use the dojo_base_rdd  which is the one that tells page automation to use Dojo widgets for input fields.    You can use an override in your Theme builder for mobile profile to tell it to use the dojo_base_rdd but be sure to test out the performance over mobile, and the behavior of all the input widgets to be sure that they work ok for the device types you need to support.

     

    I hope that info helps,
    ..Mike Burati 
    The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM.