Forums

mini form into larger form

forumsviewer 04 Nov, 2010
hi folks

i'm fairly new to chronoform and have really enjoyed working with it. i am not new to php/html/css though so i believe i can get this to work with a little bit of guidance.

on the front page i want to have a mini form that asks four questions. I then want that when a user fills in the four questions and clicks "submit" to do a few things

1. Email me the information in the mini form (or input into database)
2. Redirect user to larger form where the mini form questions that they answered will prepopulate those same questions on the larger form.

I am assuming that this can be done using POST or GET, although GET may be easier for diagnostics while initially setting this up.

Can I receive a little bit of guidance on this? A little note is that I use aceSEF, so the larger form doesnt end in .php (I could edit aceSEF so that it does, but still not sure if it matters), so i'm not sure how that carries the variables from one page to another in this circumstance.

THX!
GreyHead 05 Nov, 2010
Hi forumsviewer,

You can pass the info with get directly to the second step. I'm pretty certain that AceSEF will attach the query string OK.

Or you could use post and temporarily save the results in the User Session (or a cookie) then redirect and pick the results up again in the second form.

Bob
forumsviewer 05 Nov, 2010
Hi Bob,

I'll need to use POST for production.

What area in Chronoforms would I input html/php coding to add a quick session for the next page? Couldn't I somehow edit the second page form to use $_POST['variable'] to grab the info from the first page?
GreyHead 06 Nov, 2010
Hi forumsviewer,

Couldn't I somehow edit the second page form to use $_POST['variable'] to grab the info from the first page?

Yes, probably, test it to see. I've never quite certain when the $_POST array gets unset.

If you use the session you'd set the value in one of the form OnSubmit code boxes and look it up again in the Form HTML of the next form.

Bob
forumsviewer 10 Nov, 2010

Hi forumsviewer,

Couldn't I somehow edit the second page form to use $_POST['variable'] to grab the info from the first page?

Yes, probably, test it to see. I've never quite certain when the $_POST array gets unset.

If you use the session you'd set the value in one of the form OnSubmit code boxes and look it up again in the Form HTML of the next form.

Bob



I'm not sure how to pull the variables from the actual form from within the onsubmit using php. I know how to do it on a normal form, but not Chronoforms (not positive on its internal processing).

Also, how would I be able to, eithout manually editing the actual HTML each time I make a wizard edit to the form to put in the cookie information into the appropriate form item space (prefill)? I am assuming i'm going to have to manually edit the html of the code using the "value="<?php echo $_COOKIE['name']""and then just avoid the wizard?
forumsviewer 10 Nov, 2010

Hi forumsviewer,

Couldn't I somehow edit the second page form to use $_POST['variable'] to grab the info from the first page?

Yes, probably, test it to see. I've never quite certain when the $_POST array gets unset.

If you use the session you'd set the value in one of the form OnSubmit code boxes and look it up again in the Form HTML of the next form.

Bob



I'm not sure how to pull the variables from the actual form from within the onsubmit using php. I know how to do it on a normal form, but not Chronoforms (not positive on its internal processing).

Also, how would I be able to, eithout manually editing the actual HTML each time I make a wizard edit to the form to put in the cookie information into the appropriate form item space (prefill)? I am assuming i'm going to have to manually edit the html of the code using the "value="<?php echo $_COOKIE['name']""and then just avoid the wizard?



After playing around with it a bit you can pull the form submission within the onsubmit after email section by using $_POST['variable-name'] and then put that into a session and then use that session in the "value" section of the secondary form. There is obviously some manual editing by doing this.

Any more efficient or effective ways of accomplishing this task?
forumsviewer 10 Nov, 2010
lol well passing everything is going well, except for the email address. Joomla loves to edit the email address and put in the value field instead of the email address a javascript code


 <script language='JavaScript' type='text/javascript'>  <!--  var prefix = 'ma' + 'il' + 'to';  var path = 'hr' + 'ef' + '=';  var addy58112 = 'example' + '@';  addy58112 = addy58112 + 'example' + '.' + 'com';  document.write( '<a ' + path + '\'' + prefix + ':' + addy58112 + '\'>' );  document.write( addy58112 );  document.write( '<\/a>' );  //-->\n </script><script language='JavaScript' type='text/javascript'>  <!--  document.write( '<span style=\'display: none;\'>' );  //-->  </script>This e-mail address is being protected from spambots, you need JavaScript enabled to view it  <script language='JavaScript' type='text/javascript'>  <!--  document.write( '</' );  document.write( 'span>' );  //-->  </script>


No matter what, if there is a [email]something@something.com[/email] it will replace the field with this nonsense. Any idea on how to get rid of it? I already tried using onsubmit javascript on the first page to change the @ to a + and then on the actual next form page change the + back into a @ using php but if it is in a field value it puts in that javascript.


EDIT:
This seems to be a "email cloaking" plugin that I simple disabled and then it worked. Yay!
GreyHead 17 Nov, 2010
Hi forumsviewer,

You have the Joomla! Email Cloaking Plug-in enabled and it is trying to cloak the sample e-mail in the ChronoForms validation message. Disable the plug-in temporarily to check this is the problem. If you need the plug-in change the plug-ins order so that Email Cloaking runs before ChronoForms.

NB These are Joomla! plug-ins that you manage from Site Admin | Extensions | Plug-in Manager

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