How to have multiple Form tag attachment

Ron 20 Oct, 2011
Hello,

I have a situation that I have to have multiple Form tag attachment could anyone suggest how to do it. I googled it and found many suggestions but none of them worked for me.

Thanks

Ron
GreyHead 20 Oct, 2011
Hi Ron,

Sorry, I don't understand the question. Can you give an example?

Bob
Ron 20 Oct, 2011
[attachment=0]attach.PNG[/attachment]Thanks Bob,

Please see the attachment

Ron
GreyHead 20 Oct, 2011
Hi Ron,

And the problem is??

Bob

PS I think it may need to be onSubmit with a capital S
Ron 21 Oct, 2011
Hello Bob,

I just need to know if I have multiple form tags how to I use them in one field :
example:
If I have : onSubmit="return emailCheck(this.email.value)"
and then I have: onSubmit="ValidatethisForm()"

How do I do this.

Ron
GreyHead 21 Oct, 2011
Hi Ron,

Just link them into a single line of JavaScript
onSubmit="ValidatethisForm(); return emailCheck(this.email.value);"

But better practice to use the MooTools addEvent syntax in the Load JS action - something like this
$('submit')addEvent('click', function() {
  ValidatethisForm();
  return emailCheck(this.email.value);
}

Bob
Ron 27 Oct, 2011
Thanks for the reply Bob,

Is it possible I can put the following code in the form html ?This code is between script tags. I am sorry the forum does not let me put the script tags in the code.

../scripts/scripts/file1.js,file2.js,file3.js,file4.js,file5.js

I get conflicts if I put these java scripts in the header of the index.php file so I want to have selective java scripts as dynamic files to my forms.

And also in the code you mentioned:
$('submit')addEvent('click', function() {
  ValidatethisForm();
  return emailCheck(this.email.value);
}

Is it possible to have more then two functions at the same time. say an onSubmit="return checkCheckBox(this)"

Thanks for all the help.
Best wishes to you

Ron
GreyHead 29 Oct, 2011
Hi Ron,

I don't understand what this is meant to be?
../scripts/scripts/file1.js,file2.js,file3.js,file4.js,file5.js
Is is ta list of files?

You can't add a list of files like that - you can add several individual fles but you need to full file URLs to do so.

And, yes you can add more than one event watcher or function. Check the MooTools docs for more info.

Bob
This topic is locked and no more replies can be posted.