Results 1 to 3 of 3

Thread: SidecreateView javascript validation for customized Fields

  1. #1
    varunshah is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default SidecreateView javascript validation for customized Fields

    Hello,
    I have added customized fields in sidecreateview. Now i want to add javascript validation for that fields.
    My code is like this.....

    'javascript' => '<script type="text/javascript" src="custom/modules/opportunities/metadata/side_options.js"></script>',


    ///This way i include the js file.

    array (
    array('name'=>'opportunity_qty_c',
    'displayParams' =>
    array (
    'required' => true,'javascript'=>'onchange=calculate();',
    ),),
    ),
    ///This is my customized field. In this i add onchnage event, but it is not working


    side_options.js
    function calculate()
    {
    alert("calculation");
    }
    /// this is my .js file where i put my function..

    .
    Thank You in advance.

  2. #2
    ishaan is offline Senior Member
    Join Date
    Apr 2009
    Location
    Mumbai,India
    Posts
    100

    Default Re: SidecreateView javascript validation for customized Fields

    Quote Originally Posted by varunshah View Post
    Hello,
    I have added customized fields in sidecreateview. Now i want to add javascript validation for that fields.
    My code is like this.....

    'javascript' => '<script type="text/javascript" src="custom/modules/opportunities/metadata/side_options.js"></script>',
    Where have u added the above line.....tell me exactly .

    Cheers,
    Ishaan

  3. #3
    varunshah is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default Re: SidecreateView javascript validation for customized Fields

    Thanks for reply
    //////////////////////////////////////////////// Code start
    $viewdefs['Opportunities']['SideQuickCreate'] = array(
    'templateMeta' => array('form'=>array('buttons'=>array('SAVE'),
    'headerTpl'=>'include/EditView/header.tpl',
    'footerTpl'=>'include/EditView/footer.tpl',
    'button_location'=>'bottom',
    ),
    'javascript' => '{$PROBABILITY_SCRIPT}',

    'maxColumns' => '1',
    'panelClass'=>'none',
    'labelsOnTop'=>true,
    'widths' => array(
    array('label' => '10', 'field' => '30'),
    ),

    'javascript' => '<script type="text/javascript" src="custom/modules/opportunities/metadata/side_options.js"></script>',

    ),

    'panels' =>array (
    'DEFAULT' =>
    array (

    array (
    array('name'=>'name', 'displayParams'=>array('required'=>true, 'size'=>20)),
    ),
    ...........
    //////////////////////Code End


    This is the place where, i have added include file...and then after in array, i have my customized fields.
    And it is not working...

    In this, i have included it on upper javascript part also....like this...
    /////////////////////Code Start

    $viewdefs['Opportunities']['SideQuickCreate'] = array(
    'templateMeta' => array('form'=>array('buttons'=>array('SAVE'),
    'headerTpl'=>'include/EditView/header.tpl',
    'footerTpl'=>'include/EditView/footer.tpl',
    'button_location'=>'bottom',
    ),

    'javascript' => '<script type="text/javascript" src="custom/modules/opportunities/metadata/side_options.js"></script>',


    'maxColumns' => '1',
    'panelClass'=>'none',
    'labelsOnTop'=>true,

    //////////////////////////////////Code End

    These are 2 places where i have included the file.....

    Even when i add event in variable, i can't see that event in html part also.....
    like this....
    ///////////////////////////////////Code
    array (
    array('name'=>'opportunity_qty_c',
    'displayParams' =>
    array (
    'javascript'=>'onchange=calculate();',
    ),),
    ),

    ///////////////////////////////////Code End
    But It is not showing this event for this field.
    I know only this one way, to add event for the field..but that is also not working...
    Last edited by varunshah; 2009-05-19 at 08:29 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. custom JavaScript validation
    By waverider in forum Developer Help
    Replies: 2
    Last Post: 2010-05-01, 09:35 PM
  2. Javascript validation
    By ishaan in forum Developer Help
    Replies: 4
    Last Post: 2009-05-20, 07:21 AM
  3. Custom javascript validation
    By aswath28 in forum Developer Help
    Replies: 10
    Last Post: 2008-12-16, 09:10 AM
  4. javascript - turn of validation on a field
    By mikesolomon in forum Developer Help
    Replies: 3
    Last Post: 2008-06-19, 07:48 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •