PDA

View Full Version : extra text entry fields for products


jmedinger
30-Apr-2003, 02:27 PM
Hi there,

I've a colleague who is trying to create a system whereby when a product is ordered, the customer is requested to give 3 email addresses in 3 separate text boxes.

The Extra Info prompt gives 1 text box however there does not appear to be a way to increase this.

Does anyone know a way around this?

Cheers

Jos

garyhay
30-Apr-2003, 06:36 PM
Norman has a patch for this. It's on the forum somewhere

Jan
30-Apr-2003, 09:10 PM
The fix is at http://www.rouxel.cwc.net/actinicstuff.html, search for extra information. I've tried it and it is simple to install and works really well.

Regards

NormanRouxel
30-Apr-2003, 10:36 PM
Here's a quick and dirty way that won't check for empty entries and presents the results somewhat clumsily.


<!-- Fitting 3 items into the Other Info Prompt --> Simple version.

Make a renamed copy of your Act_ProductLine.html template (or whatever one you're using).
Set the OtherInfoPrompt in the Product details as appropriate.
Use the new renamed copy of your Act_ProductLine.html template for this product
In your new Product template replace the fragment "NETQUOTEVAR:OTHERINFOPROMPT" with the following code. -->

<!-- NETQUOTEVAR:OTHERINFOPROMPT-->
<script language=JavaScript>
function formfield(fname){ // look through all forms 'till one containing field "fname"
var df = document.forms; // simplified version - only return object fname
var i = df.length - 1;
for ( var j = 0; j <= i; j++ )
{
var k = df[j].length - 1;
for ( var l = 0; l <= k; l++ )
{
if ( df[j].elements[l].name == (fname) )
{
return df[j].elements[l];
}
}
}
alert('Cannot find field ' + fname); // shouldn't happen...
return false;
}

function merge3(prodref){
formfield('O_' + prodref).value = 'Email 1: ' + formfield('Email1_' + prodref).value + ' '
+ 'Email 2: ' + formfield('Email2_' + prodref).value + ' '
+ 'Email 3: ' + formfield('Email3_' + prodref).value;
}
</script>
<br>Email 1: <input type=text size=40 name="Email1_NETQUOTEVAR:PRODUCTREFERENCE" onchange="merge3('NETQUOTEVAR:PRODUCTREFERENCE');">
<br>Email 2: <input type=text size=40 name="Email2_NETQUOTEVAR:PRODUCTREFERENCE" onchange="merge3('NETQUOTEVAR:PRODUCTREFERENCE');">
<br>Email 3: <input type=text size=40 name="Email3_NETQUOTEVAR:PRODUCTREFERENCE" onchange="merge3('NETQUOTEVAR:PRODUCTREFERENCE');">
<input type=hidden name="O_NETQUOTEVAR:PRODUCTREFERENCE" value="">


If you need more error checking, etc then it'll have to be my big patch mentioned above.

Norman

NormanRouxel
30-Apr-2003, 11:55 PM
PS. If you want to check the fields before submission and you're using Quantity on Product page without the SIngle Add to Cart
then you can replace NETQUOTEVAR:ADDTOCARTBUTTON with the following:-


<!-- NETQUOTEVAR:ADDTOCARTBUTTON -->
<script language=JavaScript>
function check3mail(prodref){
if ( (formfield('Email1_' + prodref).value == "")
||(formfield('Email2_' + prodref).value == "")
||(formfield('Email3_' + prodref).value == ""))
{
alert('You must fill in all 3 Email addresses');
return false;
}
return true;
}
</script>
<INPUT TYPE="IMAGE" SRC="addtocart.gif" NAME="_NETQUOTEVAR:PRODUCTREFERENCE" WIDTH="69" HEIGHT="15" BORDER="0" onclick="return check3mail('NETQUOTEVAR:PRODUCTREFERENCE')">


Norman

p.p.s. If you're doing this on lots of products you may want to move all the JavaScript into the HEAD of Act_Primary.html. I.e. Everything between <script...> and </script> inclusive.

jmedinger
01-May-2003, 08:12 AM
Thanks to one and all for your contribution to this

I'll let my colleague know and get back to you if there are any hitches!

Jos

golsupport
01-May-2003, 08:44 AM
Will look out for the patch... but would be great if Actinic could add it as a baseline feature / upgrade?

golsupport
01-May-2003, 08:56 AM
(added to message above)

... because I would worry that when Actinic next update their software it would clobber the non-Actinic patch installed??