Title: Message
Robin might have hit the nail on the head, but if you have problems with that you could get the cfform generated code and  copy it into a cfml template and it'll still work, cause its just html and _javascript_.
 
 This way you still have all the _javascript_ from CFFORM, then you'll be able to append your own custom validation into cfforms _javascript_.
 
Might take a bit of playing with, but it'll definetely work.
 
Mark
-----Original Message-----
From: Rich Wild [mailto:[EMAIL PROTECTED]
Sent: 29 June 2004 15:14
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] cfform[Scanned]

Thanks Mark, I agree - but how can I stop this happening and actually get cfform to kick off an extra custom validation (ie mine) after *its* finished?

 


From: Mark Smyth [mailto:[EMAIL PROTECTED]
Sent: 29 June 2004 15:10
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] cfform[Scanned]

 

I think its the onsubmit Rich

 

When cfform creates the _javascript_ is initiates the validation by dynamically adding an onsubmit

 

so what you'd end up with in the browser is something like

 

<FORM NAME="itemFrm" ACTION="" METHOD="POST" ENCTYPE="multipart/form-data">

 

its basically overwritting your onsubmit, or it sounds like they might even be conflicting

hth

mark

-----Original Message-----
From: Rich Wild [mailto:[EMAIL PROTECTED]
Sent: 29 June 2004 14:48
To: [EMAIL PROTECTED]
Subject: [ cf-dev ] cfform

Yuck. I've inherited code which I'm debugging and it all uses cfform, a personal peeve of mine.

 

Now, perhaps its because I came back from Glastonbury yesterday and so am a little bit mental, but I'm trying to get this cfform to fire off a validation script on submit.

 

So I've added the onsubmit parameter to the cfform call like thus:

 

<cfform action="" method="POST" name="itemFrm" enctype="multipart/form-data" >

 

And I have the following function declared just above it like thus:

 

<script>

function chkRevision() {

                        if (document.itemFrm.revision.value && !document.itemFrm.EditComments.value.length) {

                                    alert('Warning!\n\nPlease ensure that you have completed the \'Edit Comments\' field.');

                                    return false

                        } else {

                                    return true

                        }

            }

</script>

 

That should work yea? So why does the JS give me a Object Not Found error when run at the browser on this line (which is obviously created by cfform)

 

function  _CF_checkitemFrm(_CF_this)

{

            if  (!_CF_hasValue(_CF_this.title, "TEXT" ))

            {

                        if  (!_CF_onError(_CF_this, _CF_this.title, _CF_this.title.value, "Please enter Title"))

                        {

                                    return false;

                        }

            }

return chkRevision();

 

            return true;

}

 

p.s. I *would* dearly love to turn the whole form into a normal form, but there's a lot of work required (large form) to do that and this is a quick fix, very unfortunately.

 

I think I've left my mind in a field.

 

Ta everyone.

 

Rich

Reply via email to