Forums

Adding script to a post (3 posts)

  1. bsa
    Member
    Posted 1 year ago #

    I am adding some qty order buttons to my post (bsa.isgreat.org) and I have a script that runs the min/max qty formula, so if your input is below 5 and over 10 it will not let you go any further. It runs properly when I have it as html page, however when I put it in the post it does not run properly. There is a line that is altered somehow at the execution of the post.
    original script text is:

    function calcQty() {
    for (var i =1; i <=8; i++){
    var temp=eval('document.Form1.qty'+i+'.value');
    if (temp!=""&&!isNaN(temp)){
    eval('qty'+i+' = parseInt(temp)');

    the altered scipt text:

    var temp=eval('document.Form1.qty'+i+'.value');
    if (temp!=""&&!isNaN(temp)){
    eval('qty'+i+' = parseInt(temp)');

    The #038 is added somehow to the script and it messes it up.

    Any idea why it is happening and what the solution could be.

    Thanks.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

  3. bsa
    Member
    Posted 1 year ago #

    OK I tried all the options presented by the codex link but I was not sucessful at all. I even tested a scipt that works well in the post and put it as a js file, but it did not work when put in a file. I am wondering if there is a step that I am missing or if the scipt as a file does not perform. Any help would be appreciated, Thanks

    Here is the scipt:
    [Code moderated as per the Forum Rules. Please use the pastebin]

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags