Jump to content

a name not working correctly?


aggrav8d

Recommended Posts

It's mainly because you are telling it to go the same place again as you have #order_form at the 'add to cart' button.

 

Where it says this...

<td colspan='2'>Please select from the following list of options:</td>

 

Make it like...

<td colspan='2'><a href='#order_form'></a>Please select from the following list of options:</td>

 

Change the image code to...

<input type='image' name='cart' src='addtocart.png' />

 

Then put somewhere on the page...

if($isset($_POST['cart']){
header('Location: http://polycase.reverb-marketing.com/dc-34f.php#order_form' );
}

Link to comment
Share on other sites

How is that going to help?  It's totally screwing up the intent of the buttons.

The TOP add to cart should cause a jump to the BOTTOM add to cart.  There shouldn't be any need for the top one to submit a form and go through PHP and a redirect.

Link to comment
Share on other sites

How is that going to help?  It's totally screwing up the intent of the buttons.

The TOP add to cart should cause a jump to the BOTTOM add to cart.  There shouldn't be any need for the top one to submit a form and go through PHP and a redirect.

Sorry, I went about it the wrong way.

 

Keep the cart image button with the '#order_form' link, but put just underneath the second (bottom) 'add to cart' image button this...

<a name='order_form'></a>

 

Sorry man, I wasn't thinking straight.

Link to comment
Share on other sites

It was there the first time I posted the question.  >:(

 

    <div class='belly_item belly_item_wide add_to_cart'>
      <div class='top'>
        <div class='bottom'>
          <div class='belly_content tall'>
<a name='order_form'></a>
<form action='' method='post'>
<table class='order_options'>

<thead>
  <tr><td colspan='2'>Please select from the following list of options:</td></tr>
</thead>
<tbody>

 

Any idea why the browser jumps back to the top of the page when I click the "add to cart" button at the top of the page?  It should jump to the bottom and STAY THERE.

Link to comment
Share on other sites

The "add to cart" link should ONLY be a <a>. An input tag will screw things up. The browser thinks the form selfs submits so it will jump back up. Next, to make a link move the page's position you need to use an id.

 

So this is your code:

 

<a href="#cart_form">Add to Cart</a>

 

.... down the page

 

<div id="cart_form">

... cart form

</div>

Link to comment
Share on other sites

sawade, I had it both ways at various times.  Neither has worked.

 

TheFilmGod, the order_form link/achor pair has nothing to do with the input at the bottom that submits the form.  id tags have nothing to do with link/achor pairs.  Please don't drink and post.

Link to comment
Share on other sites

sawade, I had it both ways at various times.  Neither has worked.

 

TheFilmGod, the order_form link/achor pair has nothing to do with the input at the bottom that submits the form.  id tags have nothing to do with link/achor pairs.  Please don't drink and post.

 

Hmmm.  Okay.  So I decided to see if your code is validating... add well it's not.  You have 122 errors in your code.  These errors could be why it's not working for you.  I will add in the URL which I am hoping will retain your code and it's results.  http://validator.w3.org/check

 

If it doesn't.  Just copy and paste your code into the validator and it will show you the results again.  Also, I am not positive so double check in your free time.  But I believe XHTML only allows for double quotes.  IE =

<a href='textsample.php'>Site map</a>

would be

<a href="textsample.php">Site map</a>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.