This question is probably better suited to code review, but whatever.
> function Get() {
Variable names starting with a capital letter are, by convention, reserved for constructors. Also, names should indicate what the function does, a generic "get" function doesn't give much of a hint. A better name might be getFormValues.
> var Form = document.getElementById('Form');
There is a document.forms collection available that can be used as an alternative to calling a method:
var form = document.forms('Form');
> for(I = 0; I < Form.length; I++) {
You should always declare variables in an appropriate scope (noting that ECMAScript only has global, function and eval scope, there is no block scope), especially counters. Also, the form's length attribute is the number of controls in the form. Since it's a live collection, getting the length every time when you don't need to is potentially a performance hit, so cache the value:
for (var i = 0, iLen = form.length; i < iLen; i++) {
> var Value = this.attribute('name').value;
The value of this is set by how you call a function. If the function is called by a handler, then depending on the browser and method attachment, this will reference the element whose listener called the function. In this case, because the function is called by an inline listener, this has not been set so will default to the global object.
You can easily pass a reference to the element from the listener if you do:
<input ... onclick="getFormValues(this);" ... >
Now your function will receive a reference to the element and can conveniently get a reference to the form and iterate over the controls. Finally, it is rare to need to access a form control's attribute values, you nearly always want to access properties. So here's the re-written function:
function getFormValues(element) {
var form = element.form;
var controls = form.controls;
for (var i=0, iLen=controls.length; i<iLen; i++) {
alert(controls[i].name + ': ' + controls[i].value);
}
// Prevent form submission
return false;
}
Lastly, you are better to call the listener from the form rather than the submit button, since forms can be submitted by means other than clicking a submit button. Oh, and don't call any form control "submit" or use any name that is the same as a form method as it will overwrite the same–named method. You get away with it here due to capitalisation, but that is not much defense.
The related HTML can be (note that the form now doesn't need either a name or id):
<form onsubmit="return getFormValues();">
<input type="text" name="userName" placeholder="Username">
<input type="password" name="userPassword" placeholder="Password">
<input type="submit" name="submitButton">
</form>