Elmo Watson said:
<SCRIPT LANGUAGE="Javascript">
<!-- Beginning of JavaScript -
function convcaps(this)
{
document.form.this.value=document.form..this.value.toUpperCase();
}
// - End of JavaScript - -->
</SCRIPT>
What am I doing wrong here?
Top posting. Please trim your quotes instead of including the entire
message you respond to.
In HTML 4, the type attribute is required on the script tag. The
recommended way to start a script element is:
<script type="text/javascript">
You don't need the <!-- line.
And, the important errors:
1) "this" is a keyword in Javascript, you can't use it as a variable.
2) you have a variable, call it "variableName" since "this" is not
legal. It contains a string with the name of a property of the form.
You then write.
document.form.variableName.value
This finds the property with the name "variableName" in the form, not
the one with name that is in the string that variableName refers to.
To use a variable to look up a property, you must use square brackets:
document.form[variableName].value
<URL:
http://jibbering.com/faq/#FAQ4_39>
/L