The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Validating 2 Forms on One Page
I probably should have thought this through before creating 2 forms on one page. Of course, if there's 2 forms on the one page (both requiring validation) when you submit one form, rsv.js lets you know that it was unable to find a field which exists in the other form.

Is there any way that rsv.js can target each form separately?

The only work around I can think of, is to put one form in an iframe, but I don't really want to go down that road and thought I'd ask the question here first. Any help with this would be greatly appreciated.
Hi Mark,

Hmmm good question. RSV *should* still work under these circumstances. As long as you pass in the different form and the different set of rules to each, it should work okay.

<form ... onsubmit="rsv.validate(this, rules1)">

<form ... onsubmit="rsv.validate(this, rules2)">

If that's what you're doing, could you post a link to the page so I could take a look?

- Ben
Hi Ben
thanks for your response.

I can see this code needs to be added to each form, but wouldn't additional code specifying the rules1 and rules2 need to be added to the rules in the head of the page. Not sure how though.

The page in question is here:
and the 2 forms are in the tabbed slider.

Thanks again for your help.

Hi Ben
little bit of experimenting and I've managed to work it out for myself, thanks.

However, I have a gremlin crept into the works. One of the forms (id 1) does not go to the thank you page, but opens a blank page (process.php) and does not send email, although it does save the data. The other form (id 2) works perfectly. They're both set up in the same way and I'm going crazy trying to figure out what is wrong. Am I missing something, although I've checked everything many times? Any help really appreciated, thanks.
Huh, curious one! If the redirect URL wasn't specified, Form Tools would let you know, so it *sounds* like the process.php is just failing to redirect. Did you modify process.php at all?

Try add this to your /global/config.php file:

PHP Code:
$g_default_error_reporting 2047

Then put through another submission. Do you see any errors at all?

- Ben
Thanks Ben
I'm afraid I didn't have the luxury of time to resolve this, so I'm processing the other form via another method. It wasn't so important as the other form anyway.

However, frustratingly another problem has occurred.

The email file in the form returns a zero (0) in the email response and yet when I check the database the email is there in full. Really appreciate if you could please throw some light on this problem. Many thanks.
Hey Mark,

Sorry, I don't quite follow. So you're trying to include a file attachment? You say you've checked the database and see the email content? Where is that stored, exactly...? Are you using Form Tools for this, or was this just related to the validation?

- Ben
Hi Ben
what I was trying to explain is that the "email address field" in the email sent out to the administrator just has a zero (0) instead of the sender's email address (all other answers come through correctly). However, if you view the result in the database the full email address is there. Any help greatly appreciated.

Perhaps it'd be clearer if you view the test result (problem in red - should be "email address" not "0") I've pasted below:

ID 10
Tradingname abc
Legalname abc pty tld
Delivery1 1
Delivery2 2 second st
Delivery3 secondville
Deliverypostcode 1111
Postal1 3
Postal2 4 fourth st
Postal3 fourville
Postalpostcode 2222
Telephone 98989898
Fax 97979797
Mobile 88888888
Abn 111111111111
E-mail 0
Contact Mark
Position manager
Last modified 2011-10-05 4:47 PM

Thanks Ben,
Hey Mark,

Sorry for not responding sooner!

If it's being stored in the database okay, it'll be a problem with your email template: possibly the placeholder being used for the email field isn't right. I'd take a look at the email template content and check over that line. Click the "View Placeholders" link (in new 2.1.x releases) to see the list of possible placeholders & compare the email field with what's entered.

Let me know if that doesn't help!

- Ben
Hi Ben
that doesn't seem to be the problem (I just checked again). I've pasted the email template below for you to see:

Tradingname: {$ANSWER_tradingname}
Legalname: {$ANSWER_legalname}
Delivery1: {$ANSWER_delivery1}
Delivery2: {$ANSWER_delivery2}
Delivery3: {$ANSWER_delivery3}
Deliverypostcode: {$ANSWER_deliverypostcode}
Postal1: {$ANSWER_postal1}
Postal2: {$ANSWER_postal2}
Postal3: {$ANSWER_postal3}
Postalpostcode: {$ANSWER_postalpostcode}
Telephone: {$ANSWER_telephone}
Fax: {$ANSWER_fax}
Mobile: {$ANSWER_mobile}
Abn: {$ANSWER_abn}
E-mail: {$ANSWER_e-mail}
Contact: {$ANSWER_contact}
Position: {$ANSWER_position}
Last modified: {$LASTMODIFIEDDATE}
IP Address: {$IPADDRESS}

Submission made: {$SUBMISSIONDATE}

and this form field's code is:

<div class="containerleft">E-mail *</div>
<div class="containerleft2"><input name="e-mail" type="text" id="e-mail" size="40" /></div>

so it's referencing "e-mail" correctly. I'm stumped. Any light you can throw on this would really appreciated. Thanks Ben,

Forum Jump:

Users browsing this thread: 1 Guest(s)