|
Dunno if you are familiar with FusionScript yet (www.fusionscript.com) - but its pretty
easy with it -- here is an example :
<cf_fs_activeServer
action="getAttributes">
<cfif activeServer.requestMode> <cfquery datasource="myDSN" name="qUsers"> Select * from users where username = '#activeServer.username#' </cfquery> <cfif qUsers.recordCount> <cf_fs_activeServer action="return" name="usernameValid" value="no"> <cfelse> <cf_fs_activeServer action="return" name="usernameValid" value="yes"> </cfif> <cfabort> </cfif> <html><head><title>Untitled</title></head>
<script>
<cf_fusionscript action="libraries"> form.* </cf_fusionscript> </script> <cf_fusionscript
action="code">
<cf_fs_function name="checkName"> <cf_fs_activeServer action="call" page="thisPage.cfm" username="form.username"> <cf_fs_if condition="usernameValid EQ 'no'"> alert('please choose another user name'); </cf_fs_if> </cf_fs_function> </cf_fusionscript> <body>
<form>
<input type="Text" name="username" onchange="checkName();"> </form> </body></html>
Nate Nielsen
|
Title: Onvalidate attribute of cfinput...
- Onvalidate attribute of cfinput... Ron Mast
- Re: Onvalidate attribute of cfinput... Nate Nielsen
- Re: Onvalidate attribute of cfinput... ferrous
- RE: Onvalidate attribute of cfinput... Ron Mast
- RE: Onvalidate attribute of cfinput... Ron Mast
