Jan 7

You heard it here first – ok, so not first… not even close to first.

JavaScript:

Before I started on this journey my logic would have told me that JavaScript and Java are either: the same language, based off the same language, or an evolution of the same language. And how wrong I would have been! JavaScript is the code that you can use to turn a website from a static page to a dynamic and interactive one. It runs on the browser side and not the server side.

So why is JavaScript called JavaScript if it has nothing to do with Java? Check out what Wikipedia has to say…

Forms:

This is exactly what it sounds like. You have the ability to create a form on a web page. You name the type of data, the format of the data and what to do with the data. You can use JavaScript to interact with the user. For example: Check for form completeness before submitting. Seems straightforward right? It is for the most part, although it does lead me to some questions relating to Salesforce.com.

Looking at a landing page on my company site, I noticed (and knew before) that the oid, campaignid (if you have campaigns), lead source, are all hidden. I also noticed that there is no Salesforce code for each field, like first name. Here are my questions:

  1. When a user hits submit, how does it get to Salesforce?
  2. Am I missing code when I look at the page?
  3. If a field( eg. firstname) doesn’t have a Salesforce ID, how does it match?
  4. Last question: JavaScript can validate a form, such as if all fields are filled in, can it also dictate the format of the data or would you use XHTML?

I will be looking these up and posting the answers once I find them.

HTML, XHTML & CSS for Dummies is finished. Great information and I am surprised how much more I understand web design and coding. I understand the source code to web pages I look at.

I would recommend reading this book if you are starting off, it was easy to understand and a quick read. It does not go into depth by any means, but gives the reader the background to be able to go out on their own to find the resources they need. It lays the ground work for what is to come. I feel like this is a great start…

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

5 comments so far...

  • Tom Photographer Said on January 8th, 2010 at 12:39 am:

    Original! 🙂

  • Alex Sutherland Said on January 8th, 2010 at 7:02 pm:

    Good for you for undertaking this journey Jared! You will be amazed at the possibilities that open up to you as an analyst and developer as you master these building blocks to web applications.

    If I may, I’d like to offer answers to your 4 questions:

    1 & 2) If you look at the Web-to-Lead form code, right at the beginning, there is the following HTML tag:

    form action=”https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8″ method=”POST”

    Because of the “action” value, the browser knows to send the data from the form fields (including the “hidden” fields) to that URL at Salesforce when the user clicks “Submit”.

    3) Salesforce only provides a Salesforce ID for custom fields. The standard fields like “first_name” are automatically mapped in SFDC’s server-side code because the names will never change and don’t need a GUID because they are associated with your org by the hidden “oid” field value. If you changed the “id” of the “first_name” field to something else, then the field would no longer get mapped to the Lead record.

    4) Yes, JavaScript is often the method of doing all validations on form data. I suppose XHTML could do some limited validation, but, most of the time you’ll need to do with with JavaScript. There are already a host of validation functions available in open-source JavaScript libraries.

    Hope this helps!

  • Jared Said on January 9th, 2010 at 6:48 am:

    Thanks Alex! I should have known to look at the top of the page – I do see the coding now! I appreciate you taking the time to answer these questions. So far this has been a lot of fun and very interesting – everything is an “A Ha!” moment and falling into place. I won’t hesitate to ask more questions to you in the future! Thanks again!

  • Journey Into The Cloud - JavaScript Review Said on January 17th, 2010 at 8:43 pm:

    […] Review Technology C++, Cheat Sheet, JavaScript, Study Add Comment (0) In a previous post, (JavaScript != Java)… I had covered what JavaScript can do for a webpage and thanks to a great comment from […]

  • web design dublin Said on January 24th, 2010 at 4:23 pm:

    Good article…I will use some of these technical principles myself…more great info please…

leave a reply