PDA

View Full Version : Java Script


wyldflrs
03-25-2002, 01:04 PM
Hi, I hope some of you that know how to write Java Script can help me out :) The thing I'm trying to do is make a drop down menu with a list of items to buy through PayPal, instead of having a bunch if single item buttons on my page. I went to PayPal and did find a link from there to a page that has the idea of how to do just what I want. However I have NO idea how to write Java Script, so reading this information really confused me :confused: The link to the page with the information on how to make the drop down menu is here: http://members.aol.com/paypalhelp/ If any of you can help me I would appreciate so much All I would need is the code for just one item, and I could figure out the rest. Code already made I can figure out and modify, making the code from scratch is were I get lost..LOL. I'd be willing to "trade" my work with yours. :cool: The link to my site for what I do is here http://www.psychictriad.com Thanks, Shelby~

P.S. I posted this on the programing board too. I hope no one minds :p

lilz
03-25-2002, 01:15 PM
Hi,

I can definitely write a JS for you. Tell me exactly what you need on it and I will write it for you today.:)

Sound good?

Your friend,
Zach

Peace & Jah Love

lilz
03-25-2002, 01:38 PM
Hi,

This Zach again. I have a basic/generic code for you, but if you want me to make it specific for your site, just tell me what you need.

Just download the .txt file and copy it into the HTML that you have and, of course, rename it whatever.html.

Here it is:

wyldflrs
03-25-2002, 01:44 PM
Hi Zach, thanks for the reply :) In my first post to the board, I said I wanted to have a drop down menu for use with PayPal orders. I hate having all those single item purchase buttons...There is a link in that post to a site that has sample code of how to do just that. The information I would need to be able to place in the form that works with the script; the item name, price, and the name of the reader who the order is being placed for. If you visit my site http://www.psychictriad.com and go to any of the readers order pages, you will see a drop down menu for my merchant account, just above the paypal payment option. I would like for paypal order form to function the same as my merchant form does...In the link: http://members.aol.com/paypalhelp/ is code to tell you how to do it to make a drop down menu for PayPal. I'm sure once I see the code, I will be able to modify it to fit the orders for each reader. I just cant write java script. I'm good at modifying Java Script and CGI code that has already been written, just cant create it ;) Thank you so much for taking the time to help me out. And I want to trade my work for yours. Let me know if there is anything else you need :) Shelby~

wyldflrs
03-25-2002, 01:52 PM
Hi again, thanks for sending the code for the pull down menu :) I have a code like that already, and using it for my merchant now. What I'm looking for is a menu script that will work with PayPal. There is code in the aol link above of how to do it, but I just cant make heads or tails of it because I do not know how to write java script :(

lilz
03-25-2002, 01:52 PM
Hi Shelby,

You are welcome!:) Glad to help! If you need anything else...like specific JS manipulation of that code for your site, just let me know! Take care,

Your friend,
Zach

Peace & Jah Love

lilz
03-25-2002, 01:54 PM
Hi Shelby,

I don't know what I was thinking. Here, I will try to get that script to you sometime today, okay?

Sorry about that...I misunderstood you.

Your friend,
Zach

Peace & Jah Love

wyldflrs
03-25-2002, 01:58 PM
No Problem ;) And I look forward to hearing from you after you have had a chance to have a look at the sample code on the aol site for the pull down menu that works with paypal :cool:

lilz
03-25-2002, 02:10 PM
Hi Shelby,

Here is the code that you will need. I have added comments to it in red. You don't have to keep the comments in there if you don't want them:

OPEN IT WITH WORDpad NOT NOTEpad!

Okay, you want to place this code inside the head tag of your site. Other than that, you should be good to go. If you need further help, I can try, but this is a REALLY good script for the PayPal problem.

Here's the JS:

Your friend,
Zach

Peace & Jah Love:)

wyldflrs
03-25-2002, 02:22 PM
Thank You! Will place this in my page today and test drive it :) I meant it when I said I wanted to trade my work for yours..just let me know when you're ready :) Thanks again, Shelby~

wyldflrs
03-25-2002, 03:45 PM
Hi Zach, I hate to be a PITA, but after looking at the script...I don't see anyplace where it calls for the drop down menu information (?) And I cant get it to work with a drop down form yet...I went back to the code on the aol site I sent you to have a look at and I did see something that looks like it calls the form information...it is this:

{ // get the dropdown stuff... obj = docobj["f" + i]; // The document object pick = obj.selectedIndex; // which option selected aray[i] = obj.options[pick].text; // isolate it // get any price values from data temp = unescape (aray[i]); // unescape it to work with it pos = temp.indexOf ("@$"); // is there a initial value? if (pos > 0)

If I'm wrong about this, I'm really sorry. If I'm correct, is there a way to incorporate this into the script you sent me? Thanks :)

lilz
03-25-2002, 03:50 PM
Hey Shelby,

That code will work just fine for getting your form information. Just put that in the script where I put in the line about retrieving the information about the product. That will do it.

If you need anything else, just ask, and I will try to help you out.

Your friend,
Zach

Peace & Jah Love

lilz
03-25-2002, 03:56 PM
Hi Shelby,

After looking at that page you sent me, it seems as if the file you looked at on doing it via form is the only thing that you will need. Just copy that into your HTML page and viola!:)

Your friend,
Zach

Peace & Jah Love

wyldflrs
03-25-2002, 06:37 PM
OK, I'm really feeling stupid here :rolleyes: and pulling my hair out :p I got the all the code in my page, set up my form...and when I choose an option form the drop down menu, it takes me to my shopping cart at paypal...BUT nothing is showing up in the description boxes in the cart. No item name, description, price...natta...I dunno what to do, and I've been messing with this so long I'm ready to scream ;) <quick, cover your ears and run>...LOL

lilz
03-26-2002, 08:43 AM
Hi Shelby,

Just send me a copy of the code that you have right now and I will try to look at it to see what is going wrong. Send me the FORM and the JS, okay?

Your friend,
Zach

Peace & Jah Love

wyldflrs
03-28-2002, 02:33 PM
Hi Zach, A quick note to let you know I sent an email to the guy of that site I sent you to...He replied and told me that he put up the wrong code on the page. Said he would be adding the right code sometime soon..... He said that PayPal recently changed the format of their shopping carts, and that the new code would work with them. Thanks for your support and helping me with this, much appreciated :cool: Shelby~

lilz
03-30-2002, 12:17 PM
Hi,

Man, that is a relief, because I was looking at the code that I told you was right and I couldn't figure out why it wasn't working for you.

Well, that makes sense because if PayPal changed its format, then it wasn't something wrong with my code, but something that they changed on there end.

I'm glad it was something with them. I hope that I have helped you. If you need anymore help, don't hesitate to ask me!

Your friend,
Zach

Peace & Jah Love