Forums

can i use chronoforms for virtuemart registration?

bonbin 15 Mar, 2011
hello everyone,

since i have an unused license, so i was thinking about using chronoforms for my another website.
can we use chrono forms for virtuemart?
if the answer is yes, so here we go
my scheme is like this :

i want to create a registration form with "City" as drop down , since as we know on the joomla/virtuemart resgitration using text box for their "city"
but i also want that drop down on dynamic, what i mean in here is when people choose "A" for their state, then the "city" dropdown only have a city in "A" state
just like when we choose the country in registration, we only see the option for the state depend on which country we choose.

i understand few basic of php and html, but i believe this will includes the sql and im totally noob with database😟
so if someone understand about how to, or know where i can find a way to do that
please help me .

many appreciate for any help in the future🙂
GreyHead 15 Mar, 2011
Hi bonbin,

I believe that you can use a ChronoForm with Virtuemart because other users have posted about it. I have no personal experience.

You can do the double drop-down with a two step form or with Ajax in the same form. There's a tutorial document on creating a double drop-down with Ajax that you can buy here on my site.

Bob
bonbin 15 Mar, 2011
hi greyhead,

ya i did search in this forum before i post this thread
but since i only found one thread that talking about virtuemart registration without any guide, that why i try to ask again in here
also i try to find a guide about how to.. , as like on joomla registration which have a guide and makes its very easy for me to intergrated the chronoforms with joomla before

btw, i did bought your tutorial, but haven't read it yet
thx for the tutor, this would be a great help in the future.
millerdesignstudios 01 Sep, 2011
Virtuemart registration CAN be done thru chronoform. The easiest way is to create the form fields and layout in Virtuemart (it wont be pretty) then go to the registration page and copy the form code.

Copy-Paste that to notepad...format the form the way you want in a editor such as komposer or nvu.

Be sure to keep the field names intact.
I dont use the virtuemart validation script, I use the validation options in chronoforms, they are a lot cleaner. and be sure to include the hidden fields at the bottom of the form, these activate the virtuemart form script.

For the auto-populate function you are wanting, in the form code javascript field put:

function ShowField(obj,id,match){
     txt=obj.options[obj.selectedIndex].text;
     if (txt.match(match)){
          document.getElementById(id).style.visibility='visible';
     } else {
          document.getElementById(id).style.visibility='hidden';
     }
}

Execute the function in the master field with this:

     onchange="ShowField(this,'slavefieldid','match')


ie:

<select name="vm_companytype" id="vm_companytype" class="inputbox" size="1" onchange="ShowField(this,'vm_companytypeother_field','Other');"></select>
<input id="vm_companytypeother_field" style="visibility: hidden;" name="vm_companytypeother" size="30" value="" class="inputbox" type="text">


In your case create multiple select drop downs, each one with the same name, but different id's depending on the master dropdown. You will have to change the javascript code a bit...the code above only works with one master and one slave pair, you could add some if statements to get multiple slaves. so:

if (txt.match(state_name)){
     document.getElementById(slavecitylist).style.visibility='visible';
} else {
          document.getElementById(slavecitylist).style.visibility='hidden';
}

You can add an if line for each state you want to put. then where it says slavecitylist put the id of the hidden slave city list.
millerdesignstudios 01 Sep, 2011
Now i have a question....

I have got the add shopper function working, but the form is completely bypassing emailing the form, I have tested the functions independently and they work great. But they dont work together. Any ideas on how to take the posted data and resubmit it after email to the virtuemart form script?
GreyHead 02 Sep, 2011
Hi millerdesignstudios.

Which version of ChronoForms are you using? You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6.

How are you submitting the form data to VirtueMart?

Bob
millerdesignstudios 02 Sep, 2011
CF V 3.2
Joomla Version 1.5.23

Virtuemart has a form handler that is called via the component automatically, it's the only way it works.

So I put nothing in the submit url, because the url is index.php joomla catches the form and send it's the the virtuemart component.

There are hidden fields that activate the component

<input name="Itemid" value="1" type="hidden">
<input name="gid" value="0" type="hidden"><input
 name="id" value="0" type="hidden">
<input name="user_id" value="0" type="hidden"><input
 name="option" value="com_virtuemart" type="hidden">
<input name="useractivation" value="1" type="hidden"><input
 name="func" value="shopperadd" type="hidden">
<input name="page" value="checkout.index" type="hidden">


I have even tried placing those fields in the "On Submit code - after sending email:" but it sends the email but doesn't add the user. I would do a direct write to the database but there are many tables with the related data. (users, user, info, vendor).
GreyHead 02 Sep, 2011
Hi millerdesignstudios,

Have you tried the Bixie module for VM. That is supposed get ChronoForms to work with VM?

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