Archive for the 'Javascript' Category

Salesforce – Hide standard buttons display (Working version)

There are many a times where we want to remove few standard buttons from page layout, but there is no such option to remove such restricted buttons. Few such buttons are … “New Note” or “Attach File” button on Google Docs, Notes, & Attachments Related list “Save & Send Invitation” button on New Event page [...]

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
16 August 2010 at 16:34 - Comments

YUI Library – The transparent mask turns black in IE 8

Problem Statement I use the YUI dialog in my project and turn on the “modal”, the initializing code looks like: document.mainDialog = new YAHOO.widget.Dialog("mainPanel", { modal: false, width: "89em", height: "30em", fixedcenter: true, visible: false, constraintoviewport: true }); The modal works fine in IE 7.0 and Fireforx 3.0, it generates a transparent mask to prevent [...]

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
23 March 2010 at 19:09 - Comments

Submit a Form in Internet Explorer with Enter

Ran into an (other) interesting Internet Explorer bug. Seems that if you have a form with only a single text input, hitting the enter button will not submit the form in IE. <form action="" method="post"> <fieldset> <label for="user_name">User Name</label> <input type="text" name="user_name" id="user_name" /> </fieldset> <fieldset class="button"> <button type="submit" name="submit" id="submit" title="Verify User Name">Verify User [...]

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
17 November 2009 at 04:04 - Comments

Executing JavaScript on page load

Following code helps you to define any JS function to be called on page load. The tricky part of the code is that it waits until page is completely loaded. <script> function init() { alert(‘Loaded’); } var previousOnload = window.onload; window.onload = function() { if (previousOnload) { alert(‘…loading …’); previousOnload(); } init(); }</script> Share and [...]

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
4 November 2009 at 08:07 - Comments

Javascript HtmlEncode/HtmlDecode

Ack:- Lunar Media Have you ever needed to HtmlEncode a querystring using JavaScript? Yes you may say, and several people will claim that you should UrlEncode it using escape(str); For some unknown reason I tried doing exactly that and UrlDecode the variable in csharp with no luck. Instead I found a solution in the Prototype [...]

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
15 June 2007 at 14:08 - Comments

Direct Population of Form Values using Javascript

Type the following code in Address bar to fill the form fields named Ad1 and Ad2 wth certain text. javascript:function A(){document.getElementById(‘Ad1′).value =”sadAS1″;document.getElementById(‘Ad2′).value = “sadAS2″;}setTimeout(‘A()’); void(0) Share and Enjoy:

Share and Enjoy:
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • RSS
9 March 2007 at 14:21 - Comments