Community Forums 

Main Content

nocart does not work on mobile version

    Nov 10 2012 22:41:34

    #1

    pcguy

    Join date : 2008-09-18      Posts : 130

    I have a cart script on my mobile site and it has the correct syntax

    <input type="hidden" NAME="nocart">

    but when the item is added to the cart it just opens the cart. Is there any way to make this behave the same as it does for the desktop version of the cart

    Thanks



    Nov 11 2012 04:07:30

    #2

    GT

    Join date : 2008-09-18      Posts : 3207

    Mobile markup is XHTML, not HTML.

    Have you tried that?

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

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




    Nov 11 2012 04:21:27

    #3

    pcguy

    Join date : 2008-09-18      Posts : 130

    No I haven't tried that Graham how is it done?



    Nov 11 2012 08:45:34

    #4

    GT

    Join date : 2008-09-18      Posts : 3207

    Markup for all content designed specifically for a mobile website must have XHTML markup.

    If your website for example is: www.domain.com/mobile/shop/product-page.html then then all pages within the /mobile directory must be XHTML.

    If you grab a mobile / iPhone / iPad and go to my website listed below, you are automatically directed to the mobile version which will be slightly different to the normal website.

    If you're saying that the nocart syntax just isn't working on a normal site for you, there is possibly another factor in your form that is possibly cancelling out the nocart. Without seeing your page holding your form, we could be here some time.

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

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




    Nov 11 2012 11:35:59

    #5

    pcguy

    Join date : 2008-09-18      Posts : 130

    Hi Graham,

    nocart works perfect on the normal site. I jsut went your your malsforms.com and the opening page looks perfect but when you tap on any links the page shinks right down

    This was viewed on a Galaxy S3

    Here is my code to the script that won'd do the no cart correct.

    If you view www.grahamscomputers.summerland.net.au on a mobile then go to shop and add an item to the cart you will see what happens.


    <style type="text/css">
    .selectboxes {background-color:#FFE9C7}
    </style>


    <form action="http://ww11.aitsafe.com/mobile/add.php"; method="post" name="CartForm" id="CartForm" onSubmit="return CalcPrice(this, true);">

    <input type="hidden" name="userid" value="D939432">
    <input type="hidden" name="return" value="www.grahamscomputers.summerland.net.au/mobile/m.phone0.htm">;
    <input type="hidden" name="price" value="">
    <input type="hidden" name="product" value="">
    <input type="hidden" name="units" value="">
    <input type="hidden" name="qty" value="1">
    <input type="hidden" name="scode" value="">
    <input type="hidden" NAME="nocart">
    <input type="hidden" name="required" value="">

    <table border="0" style="font-size:12px; color:black; background-color:transparent" cellpadding="2" cellspacing="2">
    <tr align="left" valign="top">
    <td valign="top">&nbsp;</td>
    <td valign="top"><strong>Select model to purchase</strong></td>
    </tr>
    <tr align="left" valign="top">
    <td><strong>Model</strong></td>
    <td>
    <select name="productlaptop" class="selectboxes" style="cursor:pointer" onChange="CalcPrice(this.form)" >
    <option value="-1">Select Model</opion>
    <option value="Galaxy S3 16Gb:649.00">Galaxy S3 16Gb</option>
    <option value="Galaxy S3 32Gb:710.00">Galaxy S3 32Gb</option>
    </select>

    </td>
    </tr>

    <tr align="left" valign="top">
    <td><strong>Colour</strong></td>
    <td>
    <select name="productcolour" class="selectboxes" style="cursor:pointer" onChange="CalcPrice(this.form)" >

    <option value="... White" selected>White</option>
    <option value="... Pebble Blue">Pebble Blue</option>

    </select>
    </td>
    </tr>

    <tr align="left" valign="top">
    <td><strong>SD 16Gb</strong></td>
    <td>
    <input type="checkbox" name="productsd" style="cursor:pointer" value="... 16Gb Micro SD:19.50" onClick="CalcPrice(this.form)" />
    &nbsp;$19.50<span style="font-size:9px">&nbsp;16Gb Micro SD</span>

    </td>

    </tr>

    <tr align="left" valign="top">
    <td><strong>SD 32Gb</strong></td>
    <td>
    <input type="checkbox" name="productsd1" style="cursor:pointer" value="... 32Gb Micro SD:34.00" onClick="CalcPrice(this.form)" />
    &nbsp;$34.00<span style="font-size:9px">&nbsp;32 Gb Micro SD</span>

    </td>

    </tr>

    <tr align="left" valign="top">

    <td valign="top"><b><span style="color:#0000FF">Total $</span></b></td>
    <td valign="top">
    <input name="DisplayPrice" type="text" class="Transparent" id="DisplayPrice" style="background-color: transparent; border: solid 1px; overflow: auto; color: red; text-align: center; width:80" readonly="true" /></td>
    </tr>

    <tr align="right" valign="top">

    <td><input type="button" name="Reset" style="cursor:pointer" value="Reset" onClick="document.CartForm.reset(); CalcPrice(document.CartForm)"></td>
    <td align="left">
    <input type="submit" name="Submit" style="cursor:pointer" value="Add To Cart" onClick="alert('Item has been added to your cart\n\nPlease continue to shop or\nClick view cart to checkout.');" >
    </tr>
    </table>

    <script language="JavaScript" type="text/javascript">CalcPrice(document.CartForm);</script>
    </form>



    Nov 11 2012 14:37:10

    #6

    GT

    Join date : 2008-09-18      Posts : 3207

    I would fix your errors on the normal pages then check the mobile pages.

    Looking at your mobile page markup, it's HTML and not XHTML:
    <!DOCTYPE·HTML·PUBLIC·"-//W3C//DTD·HTML·4.01·Transitional//EN">

    Your MIME type is incorrect for a mobile page.

    I must admit your script has me beat, I have no idea why you're using it, the form is a basic one, I don't see the need for javascript.

    Your mobile page fails validation, also you have XHTML in a HTML page:
    http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.malsforms.com%2Fgrahamscomp.html

    Also, this might help: http://ready.mobi/results.jsp?uri=http%3A%2F%2Fwww.malsforms.com%2Fgrahamscomp.html&locale=en_EN

    Scripts or embedded objects were detected in your page

    Many mobile devices do not support embedded objects or scripts and in many cases it is not possible for users to load plug-ins to add support. Content must be designed with this in mind. Even where a device does support scripting, do not use it unless there is no other way of accomplishing your objectives. Scripting increases power consumption and so decreases battery life.

    WARN near line 11 column 1
    Script detected
    <script type="text/javascript" src="../antenna/aut

    WARN near line 13 column 1
    Script detected
    <script type="text/javascript" src="../js/redirect

    WARN near line 14 column 1
    Script detected
    <script type="text/javascript">

    WARN near line 17 column 1
    Script detected
    <script src="../js/options_enc.js" type="text/java

    WARN near line 60 column 1
    Element form contains "intrinsic event" attribute(s): onsubmit
    <form action="http://ww11.aitsafe.com/mobile/add.p

    WARN near line 80 column 1
    Element select contains "intrinsic event" attribute(s): onchange
    <select name="productlaptop" class="selectboxes" s

    WARN near line 92 column 1
    Element select contains "intrinsic event" attribute(s): onchange
    <select name="productcolour" class="selectboxes" s

    WARN near line 104 column 129
    Element input contains "intrinsic event" attribute(s): onclick
    Price(this.form)" />

    WARN near line 114 column 130
    Element input contains "intrinsic event" attribute(s): onclick
    Price(this.form)" />

    WARN near line 130 column 5
    Element input contains "intrinsic event" attribute(s): onclick
    <td><input type="button" name="Reset" style="curso

    WARN near line 132 column 3
    Element input contains "intrinsic event" attribute(s): onclick
    <input type="submit" name="Submit" style="cursor

    WARN near line 136 column 1
    Script detected
    <script language="JavaScript" type="text/javascrip

    When you have everything cleaned up, let us know it the page still isn't working.

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

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