LyndonOHRC
Programmer
I would like to change the value of the attribute but if the element is <cfinput> the attribute is undefined.
I'm getting an 'object required" error trying to set the value so I am outputting the value.
If the html is like this example "undefined" is returned to the alert function.
If the html is like this then the value of the attribute is returned to the alert function as I had expected.
I'm confused because the required attribute seems to work correctly within the cfinput tag, I just don't know how to set it...
Any help appreciated.
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
I'm getting an 'object required" error trying to set the value so I am outputting the value.
Code:
<script type="text/javascript">
function DisplayForm()
{
alert(document.forms["frmMain"].elements["Test"].required);
}
</script>
Code:
<cfform id="frmMain" name="frmMain">
<cfinput type="Text" required="No" name="Test" value="Test" >
<input type="button" value="Test" onclick="DisplayForm();" />
</cfform>
Code:
<cfform id="frmMain" name="frmMain">
<input type="Text" required="No" name="Test" value="Test" >
<input type="button" value="Test" onclick="DisplayForm();" />
</cfform>
I'm confused because the required attribute seems to work correctly within the cfinput tag, I just don't know how to set it...
Any help appreciated.
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey