Community Forums 

Main Content

Continue shopping return address

    Oct 04 2012 16:42:14

    #1

    DaveZ

    Join date : 2009-08-12      Posts : 18

    Is there a way to return customers to the page they just ordered from without hard coding each page individually? I may have 150 different products with description pages and drop down ordering forms

    I thought return="" would do it but it only gives me an invalid address message



    Oct 04 2012 16:52:43

    #2

    Debbie Q

    Join date : 2008-09-18      Posts : 4995

    Debbie Q

    Mal's Support: www.mals-e.com/support.php
    GT's Forms and examples: www.malsforms.com
    Helpful java scripts: www.gemasana.com/mals
    Shipping help documents: www.stoner.org.uk/mals

    My Create-A-Book Publishing - mycreateabook.com
    Personalized Books, Music CDs and Gifts for all ages and occasions.

    Please help me out and share my site on your networks.




    Oct 04 2012 18:58:57

    #3

    DaveZ

    Join date : 2009-08-12      Posts : 18

    This might work if I could understand what to do. I don't have an extensive knowledge of coding so would it be possible for you to simplify the instructions?



    Oct 05 2012 06:22:17

    #4

    GT

    Join date : 2008-09-18      Posts : 3212

    You don't need to bother about coding, just understanding my weird English :)

    Use this example of a form to return the viewer to the same page they left without having to use an exact return URL.

    This is useful for creating a number of forms on different pages.

    The value of elements[1] equals the line to be used, if you've placed input type="hidden" name="return" value="" on the first input line below the "form name" line, then the elements value would be [0], the second line down would be [1] etc.

    Here's the code you add to your form line:
    onsubmit="document.myForm.elements[1].value=window.location;

    You can see the [1] this means the return info is on line two below the form name line.

    In my example, the 'return' line is the second input line. If my return line was the first line below the form name line, then I would use [0].

    The page has to be uploaded to your website to work.

    <form name="myForm" action="http://ww12.aitsafe.com/cf/add.cfm"; method="post" onsubmit="document.myForm.elements[1].value=window.location;">
    <input name="userid" value="E9120065" type="hidden">
    <input name="return" value="" type="hidden">

    Not sure how I could make it any clearer for you :)

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.




    Oct 05 2012 22:24:03

    #5

    DaveZ

    Join date : 2009-08-12      Posts : 18

    I understand how to reference the correct line in the form. What I don't get is where this line of code...

    Here's the code you add to your form line:
    onsubmit="document.myForm.elements[1].value=window.location

    goes. In the buy now form or somewhere else?

    And where does this form...

    The page has to be uploaded to your website to work.

    <form name="myForm" action="http://ww12.aitsafe.com/cf/add.cfm";; method="post" onsubmit="document.myForm.elements[1].value=window.location;">
    <input name="userid" value="E9120065" type="hidden">
    <input name="return" value="" type="hidden">

    go on my website?

    I'm sorry but I just don't get it.



    Oct 06 2012 06:46:23

    #6

    GT

    Join date : 2008-09-18      Posts : 3212

    Your form line might be:
    <form action="http://ww12.aitsafe.com/cf/add.cfm"; method="post">

    Change it to:
    <form name="myForm" action="http://ww12.aitsafe.com/cf/add.cfm"; method="post" onsubmit="document.myForm.elements[1].value=window.location;">

    Having trouble with a form or need one building?
    Fast turnaround, but I do charge :)

    Mal's Forms / Scripts and the syntax are here.