I'm new to all this.
This is my brand new website and my web designer is no longer in the picture. I need to make modification to the gift option.
Currently, if someone clicks the Add a Gift Box button on my site, the charge is added to Paypal, with no message box option.
What I need is a gift box option on the sale page of each item.
If someone clicks yes, the gift message box will then be enable.
They can type in their message (with a 25 words limit).
And of coure the charge will be added to Paypal after all this.
This is what I came up with, but unforunately, it doesn't work. I know I need to add condition, but I have no idea how to do it. Please help!
Someone helped me come up with this. It works when it's alone. But when I cut and paste to one of the sales page, it doesn't work. What am I doing wrong?
<!--GIFT BOX//-->
<script type="text/javascript"><!--
var giftBoxTempFunc;
if(typeof window.onload == "function") { giftBoxTempFunc = window.onload; }
window.onload = function() {
if(typeof giftBoxTempFunc == "function") giftBoxTempFunc();
var f = document.forms['input'];
var ta = document.forms['input'].elements['message'];
window.giftBoxMessageValue = ta.value;
ta.value = '';
ta.disabled=true;
if(ta.style) {
ta.style.backgroundColor = '#ccc';
ta.style.overflow='auto';
}
f.elements['giftbox'][0].onclick = function () {
if(this.checked) {
var ta = document.forms['input'].elements['message'];
ta.disabled=false;
if(ta.style) ta.style.backgroundColor = '';
ta.value = window.giftBoxMessageValue;
}
}
f.elements['giftbox'][1].onclick = function () {
if(this.checked) {
var ta = document.forms['input'].elements['message'];
ta.disabled=true;
if(ta.style) ta.style.backgroundColor = '#ccc';
ta.value = '';
}
}
}
// -->
</script>
<form name="input" action="html form action asp" method="get">
<img src="<?php print (ICON); ?>GiftIcon.gif" alt=""><b>giftbox</b>
<br>
<input type="radio" name="giftbox" value="yes">yes
<input type="radio" name="giftbox" value="no">no
<br>
<p><b>Please enter gift message:<b>
<br><textarea name="message" rows="4" cols="20">Gift Message</textarea>
</form>
Hum, okay, everything seems to be working, except I still can't get the $4.00 gift box fee added to Paypal. Do I need an "okay" button to submit the giftbox charge?
I'm very confused and it took me all morning to get this far.
An additional button would not help. I suspect that you need an intermediate form processor, because paypal does not recognize a form control called "giftbox". That means that you will probably need to find someone to write such a script for you.
Please disregard the message earlier. It's fixed.
But I have one last question.
I'm unable to read the gift message because I don't have it directed (forwarded?)anywhere. What do I need to do for the message to be deliver to me with their invoice?
Probably what I said in reply #12 applies to that too. I just don't have experience with using Paypal like that, so I can only make educated guesses about this.
Bookmarks