Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Error while checking industry webstandards

Options
LegacyForum
LegacyForum Posts: 1,664 ✭✭
Unknown attribute in BODY: oncontextmenu
hi,
i am trying to test my application coding for industry standards complience.
i got an error saying "Unknown attribute in BODY: oncontextmenu".

but, i want this feature to be there in my screens. how can i get this done.
Is there any other alternate method to achive this in html and javascript.
Here is the line of code where the error is occuring.



Please help me in this.

Thanks and Regards,
Padmasri

Comments

  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Options
    Sorry the line was not added properly


    body oncontextmenu="return false" onload="resetInputFields('', false, false);document.forms[0].r_type.focus()"
  • LegacyForum
    LegacyForum Posts: 1,664 ✭✭
    Options
    hi,

    I believe that the rule UnknownAttribute.rule fires this message. You can modify the rule to not report an error for the oncontextmenu attribute as following:
    - The rule can be found in /rules/HTML/, or simply right click on the error message and select Edit rule.
    - Right click on the UnknownAttribute node and select Name (S)
    - In the popup dialog, type "oncontextmenu" in the Regexp box, and check the Negate checkbox, then click on the OK button. You should see a new node added that says something like Name is not oncontextmenu.
    - Save the rule.