You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Atul Vani <at...@hotwaxmedia.com> on 2010/06/01 06:41:29 UTC

Re: Form widget validation

Hello Varun,

no wonder this code is simple and correct,

just wanted to tell you that we do take some safety measures before 
writing such code,
for example,
before using $('foo') we should make sure if it even exists
or else the whole script won't load,
we do that by if($('foo')){...}

also, we need to make sure that if our script uses any element on the page
then it should execute after the element has been loaded
and we use Event.observe('window', 'load', function(){...})

i hope this info be helpful to you.

-- 
Thanks & Regards
Atul Vani
Enterprise Software Developer
HotWax Media Pvt. Ltd.
http://www.hotwaxmedia.com/
We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for yourself.


Varun Bhansaly wrote:
> Hi,
> Step 1 could be simplified as 
>
> <script type="text/javascript">
>   new Validation('form-id');
> </script>
>
> Step 2 remains the same, 
> Some tweaks are required while showing validation msgs for lookup widgets.
>
> Thanks,
>   

Re: Form widget validation

Posted by Ravindra Mandre <ra...@gmail.com>.
 Hi Jacques,
I tried the same trick that you added in FAQ but , we also have to add some
more elements here
like : for making validation for firstName which takes only letters

<field name="firstName" title="${uiLabelMap.PartyFirstName}"

 tooltip="${uiLabelMap.CommonRequired}"  widget-style="required
validate-alpha"  event="onchange"  action="javascript: new
Validation('editPersonalDetail',
                                         {immediate:
true,onSubmit:true}); ">
       <text size="25" maxlength="60"/>
</field>

but Here the problem is that when I click on the submit button , It works
fine for backend means If I added this code for partymgr then there is no
problem while I am using the same form for front end , the submit button
gets disappear. not able to get the whats the reason behind it.


Regards
Ravindra Mandre



On Tue, Jun 1, 2010 at 3:45 PM, Jacques Le Roux <
jacques.le.roux@les7arts.com> wrote:

> Right, done!
>
>
> Jacques
>
> From: "Atul Vani" <at...@hotwaxmedia.com>
>
>> Hi Jacques,
>>
>> Please modify the FAQ and replace 'formName' with 'formId'. It would be
>> clearer that way.
>>
>> Thanks :)
>>
>> --
>> Thanks & Regards
>> Atul Vani
>> Enterprise Software Developer
>> HotWax Media Pvt. Ltd.
>> http://www.hotwaxmedia.com/
>> We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for
>> yourself.
>>
>>
>> Jacques Le Roux wrote:
>>
>>> Finally I put back your code Atul: safer indeed!
>>>
>>> Jacques
>>>
>>> From: "Atul Vani" <at...@hotwaxmedia.com>
>>>
>>>> Hello Varun,
>>>>
>>>> no wonder this code is simple and correct,
>>>>
>>>> just wanted to tell you that we do take some safety measures before
>>>> writing such code,
>>>> for example,
>>>> before using $('foo') we should make sure if it even exists
>>>> or else the whole script won't load,
>>>> we do that by if($('foo')){...}
>>>>
>>>> also, we need to make sure that if our script uses any element on the
>>>> page
>>>> then it should execute after the element has been loaded
>>>> and we use Event.observe('window', 'load', function(){...})
>>>>
>>>> i hope this info be helpful to you.
>>>>
>>>> --
>>>> Thanks & Regards
>>>> Atul Vani
>>>> Enterprise Software Developer
>>>> HotWax Media Pvt. Ltd.
>>>> http://www.hotwaxmedia.com/
>>>> We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for
>>>> yourself.
>>>>
>>>>
>>>> Varun Bhansaly wrote:
>>>>
>>>>> Hi,
>>>>> Step 1 could be simplified as
>>>>> <script type="text/javascript">
>>>>>  new Validation('form-id');
>>>>> </script>
>>>>>
>>>>> Step 2 remains the same, Some tweaks are required while showing
>>>>> validation msgs for lookup widgets.
>>>>>
>>>>> Thanks,
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>

Re: Form widget validation

Posted by Jacques Le Roux <ja...@les7arts.com>.
Right, done!

Jacques

From: "Atul Vani" <at...@hotwaxmedia.com>
> Hi Jacques,
> 
> Please modify the FAQ and replace 'formName' with 'formId'. It would be 
> clearer that way.
> 
> Thanks :)
> 
> -- 
> Thanks & Regards
> Atul Vani
> Enterprise Software Developer
> HotWax Media Pvt. Ltd.
> http://www.hotwaxmedia.com/
> We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for yourself.
> 
> 
> Jacques Le Roux wrote:
>> Finally I put back your code Atul: safer indeed!
>>
>> Jacques
>>
>> From: "Atul Vani" <at...@hotwaxmedia.com>
>>> Hello Varun,
>>>
>>> no wonder this code is simple and correct,
>>>
>>> just wanted to tell you that we do take some safety measures before 
>>> writing such code,
>>> for example,
>>> before using $('foo') we should make sure if it even exists
>>> or else the whole script won't load,
>>> we do that by if($('foo')){...}
>>>
>>> also, we need to make sure that if our script uses any element on the 
>>> page
>>> then it should execute after the element has been loaded
>>> and we use Event.observe('window', 'load', function(){...})
>>>
>>> i hope this info be helpful to you.
>>>
>>> -- 
>>> Thanks & Regards
>>> Atul Vani
>>> Enterprise Software Developer
>>> HotWax Media Pvt. Ltd.
>>> http://www.hotwaxmedia.com/
>>> We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for 
>>> yourself.
>>>
>>>
>>> Varun Bhansaly wrote:
>>>> Hi,
>>>> Step 1 could be simplified as
>>>> <script type="text/javascript">
>>>>   new Validation('form-id');
>>>> </script>
>>>>
>>>> Step 2 remains the same, Some tweaks are required while showing 
>>>> validation msgs for lookup widgets.
>>>>
>>>> Thanks,
>>>>   
>>>
>>
>


Re: Form widget validation

Posted by Atul Vani <at...@hotwaxmedia.com>.
Hi Jacques,

Please modify the FAQ and replace 'formName' with 'formId'. It would be 
clearer that way.

Thanks :)

-- 
Thanks & Regards
Atul Vani
Enterprise Software Developer
HotWax Media Pvt. Ltd.
http://www.hotwaxmedia.com/
We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for yourself.


Jacques Le Roux wrote:
> Finally I put back your code Atul: safer indeed!
>
> Jacques
>
> From: "Atul Vani" <at...@hotwaxmedia.com>
>> Hello Varun,
>>
>> no wonder this code is simple and correct,
>>
>> just wanted to tell you that we do take some safety measures before 
>> writing such code,
>> for example,
>> before using $('foo') we should make sure if it even exists
>> or else the whole script won't load,
>> we do that by if($('foo')){...}
>>
>> also, we need to make sure that if our script uses any element on the 
>> page
>> then it should execute after the element has been loaded
>> and we use Event.observe('window', 'load', function(){...})
>>
>> i hope this info be helpful to you.
>>
>> -- 
>> Thanks & Regards
>> Atul Vani
>> Enterprise Software Developer
>> HotWax Media Pvt. Ltd.
>> http://www.hotwaxmedia.com/
>> We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for 
>> yourself.
>>
>>
>> Varun Bhansaly wrote:
>>> Hi,
>>> Step 1 could be simplified as
>>> <script type="text/javascript">
>>>   new Validation('form-id');
>>> </script>
>>>
>>> Step 2 remains the same, Some tweaks are required while showing 
>>> validation msgs for lookup widgets.
>>>
>>> Thanks,
>>>   
>>
>

Re: Form widget validation

Posted by Jacques Le Roux <ja...@les7arts.com>.
Finally I put back your code Atul: safer indeed!

Jacques

From: "Atul Vani" <at...@hotwaxmedia.com>
> Hello Varun,
> 
> no wonder this code is simple and correct,
> 
> just wanted to tell you that we do take some safety measures before 
> writing such code,
> for example,
> before using $('foo') we should make sure if it even exists
> or else the whole script won't load,
> we do that by if($('foo')){...}
> 
> also, we need to make sure that if our script uses any element on the page
> then it should execute after the element has been loaded
> and we use Event.observe('window', 'load', function(){...})
> 
> i hope this info be helpful to you.
> 
> -- 
> Thanks & Regards
> Atul Vani
> Enterprise Software Developer
> HotWax Media Pvt. Ltd.
> http://www.hotwaxmedia.com/
> We are the Global Leaders in Apache OFBiz, Google 'ofbiz' and see for yourself.
> 
> 
> Varun Bhansaly wrote:
>> Hi,
>> Step 1 could be simplified as 
>>
>> <script type="text/javascript">
>>   new Validation('form-id');
>> </script>
>>
>> Step 2 remains the same, 
>> Some tweaks are required while showing validation msgs for lookup widgets.
>>
>> Thanks,
>>   
>