RSS
Home
Welcome, Guest
Please Login or Register.    Lost Password?

Change contact form to aicontactsafe form
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Change contact form to aicontactsafe form
#4936
Change contact form to aicontactsafe form 2 Years, 8 Months ago Karma: 0
Hi everyone. What a great component hey... and its free.

anyways...to the issue at hand. I would like the contact link to link to my custome made aicontactsafe(component) form. Is this possible. Also I would like to know hot to add custom fields e.g onside parking-yes, double glazing windows - yes, etc.... I hope I make sense.
d3v3l0p
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#4952
Re: Change contact form to aicontactsafe form 2 Years, 8 Months ago Karma: 3
Im using AiContactSafe as a replacement contact form for the com_properties component, and have spent alot of time trying to get things just right, so I thought I would share what I have learned so far and what works for me:

To just open a form in a pop-up window this is the code I use, this code is modified in the details.php file of com_properties. You will have to locate the original code, and then replace it with what I publish here.

original code:

<?php
//if($ShowContactLink==1){
$statusC = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=1000,height=800,directories=no,location=no';
$rutaC= JURI::base().'index.php?option=com_properties&view=form1&tmpl=component&id='.$Product->id;
?>

<a href="javascript:void(0)" onclick="window.open('/<?php echo $rutaC ; ?>','win2','<?php echo $statusC; ?>');" title="<?php echo JText::_('Contact '); ?>"><?php //echo JText::_('Contact'); ?></a><br />
<?php //}?>

Modified code for popup:

<?php
//if($ShowContactLink==1){
$statusC = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=1000,height=800,directories=no,location=no';
$rutaC= JURI::base().'index.php?option=com_aicontactsafe&view=message&layout=message&pf=1&id='.$Product->id;
?>

<a href="javascript:void(0)" onclick="window.open('/<?php echo $rutaC ; ?>','win2','<?php echo $statusC; ?>');" title="<?php echo JText::_('Order or Book '); ?>"><?php //echo JText::_('Order or Book'); ?></a><br />
<?php //}?>

Okay, now.... I also wanted to have hidden fields in my form, that could be populated with things like the $Product->id and $Product->name, etc. It took me awhile to figure this out, because the examples I found, just did not work... here is the code I'm using that brings up a AiContactSafe form in the main body, not a popup, the form has hidden fields and is self populated, based on the current $Product->name

Below aics_aptname is the name of my hidden field and its being populated by the $Product->name

Just remove the original code and insert this in it's place:

<?php $CurrentUrl = $_SERVER['REQUEST_URI'] ;?>
<form name="aiContactSafeCall" id="aiContactSafeCall" action="<?php echo JURI::base(); ?>index.php?option=com_aicontactsafe&view=message&layout=message" method="post">
<a id="link_to_contact" onclick="javascript:document.aiContactSafeCall.submit();" title="<?php echo JText::_('Contact'); ?>"><?php echo JText::_('Contact'); ?></a>
<input type="hidden" name="pf" id="pf" value="1" />
<input type="hidden" name="dt" id="dt" value="1" />
<input type="hidden" name="aics_aptname" id="aics_aptname" value="<?php echo $Product->name ?>" />
<input type="hidden" name="return_to" id="return_to" value="<?php echo $CurrentUrl ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>

Hope this helps someone
Tornado
Senior Boarder
Posts: 56
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2010/08/27 16:20 By Tornado.
The administrator has disabled public write access.
 
#4953
Re: Change contact form to aicontactsafe form 2 Years, 8 Months ago Karma: 26
Big thanks
sigouil
New job => Less time :(
Platinum Boarder
Posts: 411
graphgraph
User Offline Click here to see the profile of this user
Gender: Male Location: France Birthday: 12/31
The administrator has disabled public write access.
Sorry for my English. It is a Google translation.
 
#4999
Re: Change contact form to aicontactsafe form 2 Years, 8 Months ago Karma: 0
Brilliant, Thank you sooo much !!
d3v3l0p
Fresh Boarder
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#9576
Re: Change contact form to aicontactsafe form 1 Year, 11 Months ago Karma: 0
to me it worked perfectly for the first part of the procedure, thank you!
But I got lost in order to replace the code to have hidden fields etc..
What file are you referring to?
pj1907
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#9606
Re:Change contact form to aicontactsafe form 1 Year, 11 Months ago Karma: 0
Tornado,

you say:


Just remove the original code and insert this in it's place:

<?php $CurrentUrl = $_SERVER['REQUEST_URI'] ;?>
<form name="aiContactSafeCall" id="aiContactSafeCall" action="<?php echo JURI::base(); ?>index.php?option=com_aicontactsafe&view=message&layout=message" method="post">
<a id="link_to_contact" onclick="javascript:document.aiContactSafeCall.submit();" title="<?php echo JText::_('Contact'); ?>"><?php echo JText::_('Contact'); ?></a>
<input type="hidden" name="pf" id="pf" value="1" />
<input type="hidden" name="dt" id="dt" value="1" />
<input type="hidden" name="aics_aptname" id="aics_aptname" value="<?php echo $Product->name ?>" />
<input type="hidden" name="return_to" id="return_to" value="<?php echo $CurrentUrl ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>

but what file are you referring to?
pj1907
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#9666
Re:Change contact form to aicontactsafe form 1 Year, 10 Months ago Karma: 0
UP.

Tornado or anybody else who has already successfully applied this change...
what is the file to change?
pj1907
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#9781
Re:Change contact form to aicontactsafe form 1 Year, 5 Months ago Karma: 0
Hi everyone!

I'm having a problem... I did all the steps but the link "Contact" disappear after these chenges...

Any help ou suggestion would be great!

Thanks.
jhbjoao
Fresh Boarder
Posts: 3
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1