Jumping page!

Problems installing or using the NOP Design Free Shopping Cart. **ARCHIVE** Please post new topics to one of the groups below.

Moderator: scott

Jumping page!

Postby Bjarnat » Thu Dec 12, 2002 8:15 am

I have installed the nopcart code on my pages and everything seems to work just fine with one exception. On my page I have several items and when I click the "buy" button the page always jumps to the top. What I mean is when I select to buy "item no. 8" which is let say located half way down on the page, the page after selection of this item goes to the top where "item no. 1" is...! Is there a way to prevent this? If so, how?

In case I am doing something wrong please have a look at the code of my form below:


Thanks for your help!!!


<FORM NAME="order">

<span class="small"><font color="#000099">CD</font></span>

<input type=text size=2 maxlength=3 name=QUANTITY onChange='this.value=CKquantity(this.value)' value="1">

<input type="image" src="../../images/buy.gif" value='Add to Cart' onClick='AddToCart(this.form)'>

<input type=hidden name=PRICE value="3.00">

<input type=hidden name=NAME value="My Group<br>transcendents ">

<input type=hidden name=ID_NUM value="CD">

<font color="#000099" class="small">--&gt;</font><img src="../../images/webimages/cart.gif" align="absmiddle">

<a href="../cart/managecart.htm" target="main" class="smallbld">check out</a>

</FORM>
Bjarnat
 
Posts: 32
Joined: Mon Oct 28, 2002 8:39 am
Location: Lusatia; Germany

Postby scott » Fri Dec 13, 2002 9:13 pm

Most browsers don't do that... what OS/browser are you using?
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

Jumping page

Postby Bjarnat » Sat Dec 14, 2002 8:23 pm

So far I have tested only on IE ! As I said when I click on the button it jumps to the top of the page...??? I tried to test the entire page to see whether all the item data is being passed and it took me guite a bit it finish that exactely because of this jumping up and down...

Am I doing something wrong with the form...?

Thanks for your help!!!!
Bjarnat
 
Posts: 32
Joined: Mon Oct 28, 2002 8:39 am
Location: Lusatia; Germany

Postby scott » Wed Dec 18, 2002 8:51 pm

There must be something different about your form. :? Post your URL so we can see the page... perhaps then I can figure it out, or see if it happens for me.

_Scott
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

the URL

Postby Bjarnat » Mon Jan 06, 2003 9:49 am

Hi Scott

here is the url to my "jumping page". Would greatly appreciate if you could have a look and tell me what am I doing wrong with the form.

http://www25.brinkster.com/myshoppingcart/

Huge thanks!!!

Bjarnat
Bjarnat
 
Posts: 32
Joined: Mon Oct 28, 2002 8:39 am
Location: Lusatia; Germany

Postby scott » Fri Jan 10, 2003 2:14 am

Ahh! I see your problem. Your are using an image submit button... either use:

1. A button type, with onclick == like on the freecart instruction site (http://www.nopdesign.com/freecart)

2. An href with onclick, or href pointing to cart

ie. replace:
<input type="image" src="images/buy.gif" value=' Add to Cart ' onClick='AddToCart(this.form)'>

with:

<A HREF="Javascript:AddToCart(document.thisproductsformname)"><img src="images/buy.gif"></A>

where thisproductsformname is the form name for this product (ie <form name="thisproductsformname">.

_Scott
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

Postby scott » Fri Jan 10, 2003 2:16 am

An easier way for you just came to mind as well.. change your form tags to:

<FORM NAME=order onSubmit="return false;">

that way it's just a global search and replace -- and will keep your page from jumping... the other one was too much work.

-Scott
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

Postby Bjarnat » Mon Jan 13, 2003 8:55 am

Thanks Scott!!!

I have made the changes and it works just fine. Thanks again for your help, eh!!!
Bjarnat
 
Posts: 32
Joined: Mon Oct 28, 2002 8:39 am
Location: Lusatia; Germany

Postby Bjarnat » Tue Jan 14, 2003 1:35 pm

Hey Scott,

Do you think I could I ask you an unrelated question regarding Java Script? Let me know, eh!
Bjarnat
 
Posts: 32
Joined: Mon Oct 28, 2002 8:39 am
Location: Lusatia; Germany

Postby scott » Sun Jan 19, 2003 7:51 pm

Sure ... you can always ask... I'll try to help.

_Scott
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

Postby Bjarnat » Mon Jan 20, 2003 8:06 am

I have a page with nested frames: NAVIGATION (left), TOP and MAIN.

When you choos in navigation the language option the content of NAVIGATION, TOP and MAIN changes to the respecitve language. No problem here! But when you click the back button in your browser only one frame reverts back to it's previous content. Basically, one has to click the browser back button 3 times to get all 3 frames to get back to when they stared.

Is there a way to prevent this? If so, do you think you can help?

Thanks!

Bjarnat
Bjarnat
 
Posts: 32
Joined: Mon Oct 28, 2002 8:39 am
Location: Lusatia; Germany

Postby scott » Mon Jan 20, 2003 11:25 pm

Yes -- but it will require a little work. You could either make sure the frames are 'synced' by having the main frame re-write the location of the surrounding frames if their language specifier is incorrect (not the same) or you can re-write the history when a page loads, so that 'back' is a page that will rebuild the whole frameset, instead of whatever the 'real' back was.

-Scott
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ


Return to Installation and Setup Problems

Who is online

Users browsing this forum: No registered users and 0 guests

cron