I was hoping, someone, Hatton maybe? would be able to help me Im trying to use cfform and cfinput for validation. However, although jscript is turned on it doesnt seem to work. Its very simple code <cfform action="action/template" method="post"> User Name:<cfinput name="uname" type="text" required="yes" message="please enter a user name"/> </cffrom>
I wouldnt mind using any other method to validate as long as it works. Thanks for the help.
[QUOTE=atomi]
I was hoping, someone, Hatton maybe? would be able to help me Im trying to use cfform and cfinput for validation. However, although jscript is turned on it doesnt seem to work. Its very simple code <cfform action="action/template" method="post"> User Name:<cfinput name="uname" type="text" required="yes" message="please enter a user name"/> </cffrom>
I wouldnt mind using any other method to validate as long as it works. Thanks for the help.
[/QUOTE]
Have you tried your code or are you just looking for syntax?
the syntax is correct. the problem is the code just doesnt seem to do what its suppose to. I have an input type image that submits the form (for aesthetics) and no matter what is entered the form is processed. My impression of the command required=“yes” was that it would not submit a form unless there was a text string entered. But the damn form keeps getting sent even if the cfinput is empty which creates a mess in db.
ive even trid javascript
function validateFields(form) {
if (form.login.value == "") {
alert('Please Enter a User Name');
form.login.focus();
return false;
}
return true;
and i checked the browser for support. Its frustrating to say the least.
thanks hatton
[QUOTE=atomi]
the syntax is correct. the problem is the code just doesnt seem to do what its suppose to. I have an input type image that submits the form (for aesthetics) and no matter what is entered the form is processed. My impression of the command required=“yes” was that it would not submit a form unless there was a text string entered. But the damn form keeps getting sent even if the cfinput is empty which creates a mess in db.
ive even trid javascript
function validateFields(form) {
if (form.login.value == "") {
alert('Please Enter a User Name');
form.login.focus();
return false;
}
return true;
and i checked the browser for support. Its frustrating to say the least.
[/QUOTE]
First off, take a look at the source of the page that is being generated with the CFForm option and you’ll see some pregenerated Javascript. Personally I prefer to use server-side validation (check the data after the form has been submitted and then reload the form hilighting the missing fields) over JS simply because it gives me a lot more power over the validation.
Id like to use server side validation. I was doing some cut and paste coding and funny thing. theres a difference between
?text?
and
"text"
so this was my problem.
thanks for the replys Hatton. When Im done with this site ill post it up see what you think.
also if you can give me some pointers on server side validation. Id like to have red text pop up to the side of the input field if its not validated. currently i get the “you’ve broken the internet” coldfusion box.
Imgoing ahead and using a technique from EAsyCFM at http://tutorial192.easycfm.com/ I also took a gander at your form page at your 3-ld site. Could you post or tell how you did the dual password verification? That is if your feeling helpful.
thanks again Hatton.
[QUOTE=atomi]
Imgoing ahead and using a technique from EAsyCFM at http://tutorial192.easycfm.com/ I also took a gander at your form page at your 3-ld site. Could you post or tell how you did the dual password verification? That is if your feeling helpful.
thanks again Hatton.
[/QUOTE]
I took a peek at that tutorial and it looks like a good one… Just for grins I’m including the code for the registration page on 3-ld.com so you can see it. I know that I need to move the queries over to CFStoredProc calls, just haven’t had the time to recently.
thats alot of code! I was interested in this bit of code here
<cfif (Form.cPassword NEQ Form.cPassword2) OR NOT Len(Form.cPassword)>
I feel silly for not thinking of that. Anyway. I ve got another problemo Im researching atm. Until Later!
Heh, yep that’s me alright - though my callsign has changed (was KC5SIG is now NY5I… it’s a Ham Raido thing, don’t worry)
Jonesee and the rest of the gang over at Sitepoint are really good. I’ve just gotten too busy to maintain a presence on all the different lists. Hell, I hardly have time to post on my own websites and personal blog let alone monitor message boards!