Recreating a script not to use php

  • Profile Image
    Ash
    Asked on January 25, 2012 at 06:52 PM
                             
  • Profile Image
    NeilVicente
    Answered on January 25, 2012 at 09:56 PM

    Ash,

    Can you please provide more details to your question? I am having problems trying to make out what it is about as it is a little too vague by itself.

    We looking forward to hearing from you soon.

  • Profile Image
    zugfrig78
    Answered on January 25, 2012 at 11:38 PM

    hi, neilvicente,

     

    sorry i dont know where the text in the original post went....maybe it was too long

     

    im having trouble making a form with lots of rules in it.

     

    i have a html script that was written for me some years ago for my old website that consists of 3 vertical colums. this script can be emailed to you if you like or view (not working) at www.thepclub.weebly.com/moonee-ponds.html

     

    the script was written to be submitmitted and then go to a php page which sent me the email.

     

    as it has it i am now moved to use the weebly website builder which is free and very user friendly for novices like me....however as this script is the whole purpose behind my site i am in a pickle about how to recreate a similar alternative using Jotform

     

    the background is i run a fanstasy sports competiton between myself and 9 other friends. each team has 45 names in it. each friday a user will log in to his page and of the 45 must move 18 to the left colum called team and 6 to the right colum called emergency. the purpose being the 18 are that teams squad for the week and the 6 are backups.

     

    the beutiy of my old script was there was no loopholes in it, in that

    *  no player could be selected more than once

    * i woudl get an email showing in which order each player was chosen (this is particulaly important for the emergency players given the user would rank them so that the best possible emergency player was as the top of the list to come into the team if neede)

    * finally a line of script was built in alerting a user if he has chosen too many or too players than the 18 and 6 required and not allow the form to be submitted unless it had the correct amount of players.

     

    ok so that it in a nutshell and id love to recreate it of something with a similar beahaviour however here are the issues i have

     

    i now use weebly website builder and it

     

    will allow me to custom script to a html box

    WILL NOT allow php

    WILL NOT allow uploading of anyother files via FTP to their webserver

     

    i had a go at making something in jotform which looked total different but has potential to get the same result but cant work out how to implement it given the limitaions of weebly as shown above

     

    i really need a script which is stand alone which i can embed into the weebly webpage that can alert/prevent too many or too few players from being submitted (most important) also tell me in which order the names were selected (2nd most important) and hopefully not allow a user to choose any player twice.....

     

    it looks like a tall order......

     

    if you can go to the website, here is the origianl script used which weebly cannot support.....

  • Profile Image
    zugfrig78
    Answered on January 25, 2012 at 11:39 PM

    <html> 
        <head> 
            <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> 
            <script type="text/javascript">
       var max_selected = 18;
       var max_emergency = 6;
       var total_players = 0;
       var current_player = 0;
       var current_selected = 0;
       var current_emergency = 0;
                $().ready(function() {
        total_players = current_player = $('#player_list option').length;
        updateStatusCounters();
        $('.movePlayerToSelected').click(function(object) { 
         var selected = $('#player_list option:selected').length;
         current_player -= selected;
         current_selected += selected;
         !$('#player_list option:selected').remove().appendTo('#selected_list'); 
         updateStatusCounters();
         return;
        }); 
        
        $('.moveSelectedToPlayer').click(function(object) { 
         var selected = $('#selected_list option:selected').length;
         current_player += selected;
         current_selected -= selected;
         !$('#selected_list option:selected').remove().appendTo('#player_list'); 
         updateStatusCounters()
         return;
        }); 
        
        $('.movePlayerToEmergency').click(function(object) { 
         var selected = $('#player_list option:selected').length;
         current_player -= selected;
         current_emergency += selected;
         $('#player_list option:selected').remove().appendTo('#emergency_list');
         updateStatusCounters()
         return;
        }); 

        $('.moveEmergencyToPlayer').click(function(object) { 
         var selected = $('#emergency_list option:selected').length;
         current_player += selected;
         current_emergency -= selected;
         $('#emergency_list option:selected').remove().appendTo('#player_list'); 
         updateStatusCounters();
         return;
        });
        $('form').submit(function(e) { 
         if(current_selected > max_selected)
         {
          updateStatusMessage("You have too many players in your selected list");
         }
         else if(current_selected < max_selected)
         {
          updateStatusMessage("You have too few players in your selected list");
         }
         else if(current_emergency > max_emergency)
         {
          updateStatusMessage("You have too many players in your emergency list");
         }
         else if(current_emergency < max_emergency)
         {
          updateStatusMessage("You have too few players in your emergency list");
         }
         else
         {
          return;
         }
         e.preventDefault();
        });
        
        function updateStatusCounters()
        {
         $('#selected_counter').text("Selected (" + current_selected + " / " + max_selected + ")");
         $('#player_counter').text("Selected (" + current_player + " / " + total_players + ")");
         $('#emergency_counter').text("Selected (" + current_emergency + " / " + max_emergency + ")");
        }
        
        function updateStatusMessage(message)
        {
         $('#statusMessage').text(message);
        }
                });
       
            </script> 
           
            <style type="text/css"> 
       div.column { 
        float:left;
        width: 30%;
        text-align: center; 
        margin: 10px; 
       } 
       select { 
        width: 170px; 
        height: 640px;
        font-size: 8pt;
        font-family: Arial;
       }
       .script_button {
        padding: 3px;
        font-size: 8pt;
        font-weight: bold; 
        font-family: Arial;
        margin: 10px auto 0px auto;
        display: block; 
        border: 1px solid #aaa; 
        text-decoration: none; 
        background-color: #fafafa; 
        color: #000;
        clear:both; 
       }
       #submit_button {
        font-size: 10pt;
        font-family: Arial;
        font-weight: bold;
        padding: 2px 15px 2px 15px;
        border: 1px solid #aaa; 
        text-decoration: none; 
        background-color: #fafafa; 
        color: #000;
       }
       .counters {
        font-family: Arial;
        font-size: 10pt;
       }
       #statusMessage {
        height: 20px;
        color: #e3361f;
        font-size: 10pt;
        font-family: Arial;
        font-weight: bold;
       }
            </style> 
        </head> 
        <body> 
         <form action="submit.php" method="post">
            </div>
         <div id="wrapper_selected_list" class="column">
             <div id="selected_counter" class="counters"></div>
                <select multiple="true" id="selected_list" name="TEAM[]"> 
                </select>
                <div>
                 <a target="_blank" href="#" style="width: 80%" class="script_button moveSelectedToPlayer">RETURN TO SQUAD</a> 
       </div>
      </div>
           
            <div id="wrapper_player_list" class="column"> 
            <div id="player_counter" class="counters"></div>
                <select multiple="true" id="player_list"> 
                    <option value="Aaron Davey">Aaron Davey</option>
                    <option value="Adam Goodes">Adam Goodes</option>
                    <option value="Adam Selwood">Adam Selwood</option>
                    <option value="Andrew Gaff">Andrew Gaff</option>
                    <option value="Andrew Swallow">Andrew Swallow</option>
                    <option value="Andy Otten">Andy Otten</option>
                    <option value="Angus Monfries">Angus Monfries</option>
                    <option value="Ben McEvoy">Ben McEvoy</option>
                    <option value="Brad Ebert">Brad Ebert</option>
                    <option value="Brent Macaffer">Brent Macaffer</option>
                    <option value="Cameron Bruce">Cameron Bruce</option>
                    <option value="Chris Judd">Chris Judd</option>
                    <option value="Chris Mayne">Chris Mayne</option>
                    <option value="Corey Enright">Corey Enright</option>
                    <option value="Daniel Jackson">Daniel Jackson</option>
                    <option value="Daniel Rich">Daniel Rich</option>
                    <option value="Danyle Pearce">Danyle Pearce</option>
                    <option value="David Mundy">David Mundy</option>
                    <option value="David Zaharakis">David Zaharakis</option>
                    <option value="Dustin Fletcher">Dustin Fletcher</option>
                    <option value="Eddie Betts">Eddie Betts</option>
                    <option value="Grant Birchall">Grant Birchall</option>
                    <option value="Heath Hocking">Heath Hocking</option>
                    <option value="James Gwilt">James Gwilt</option>
                    <option value="James Kelly">James Kelly</option>
                    <option value="Joel Corey">Joel Corey</option>
                    <option value="Joel Macdonald">Joel Macdonald</option>
                    <option value="Jonathan Brown">Jonathan Brown</option>
                    <option value="Jude Bolton">Jude Bolton</option>
                    <option value="Kade Simpson">Kade Simpson</option>
                    <option value="Marc Murphy">Marc Murphy</option>
                    <option value="Martin Mattner">Martin Mattner</option>
                    <option value="Matthew Scarlett">Matthew Scarlett</option>
                    <option value="Michael Johnson">Michael Johnson</option>
                    <option value="Nathan Foley">Nathan Foley</option>
                    <option value="Nathan Jones">Nathan Jones</option>
                    <option value="Nick Dal Santo">Nick Dal Santo</option>
                    <option value="Sam Fisher">Sam Fisher</option>
                    <option value="Shane Edwards">Shane Edwards</option>
                    <option value="Shane Mumford">Shane Mumford</option>
                    <option value="Shaun Burgoyne">Shaun Burgoyne</option>
                    <option value="Shaun Higgins">Shaun Higgins</option>
                    <option value="Simon Black">Simon Black</option>
                    <option value="Stephen Hill">Stephen Hill</option>
                    <option value="Taylor Walker">Taylor Walker</option>
                </select>
                <div>
                    <div style="width: 40%; float: left; margin: 0 0 0 20px;"><a target="_blank" href="#" class="script_button movePlayerToSelected">TO TEAM</a></div>
                    <div style="width: 40%; float: right; margin: 0 20px 0 0;"><a target="_blank" href="#" class="script_button movePlayerToEmergency">TO BENCH</a></div>
                    <div style="clear: both;"></div> 
                </div>  
            </div> 
            <div id="wrapper_emergency_list" class="column"> 
             <div id="emergency_counter" class="counters"></div>
             <select multiple="true" id="emergency_list" name="INT[]"></select>
                <div>
                 <a target="_blank" href="#" style="width: 80%" class="script_button moveEmergencyToPlayer">RETURN TO SQUAD</a> 
                </div>
            </div>
            <div style="clear: both; width: 100%; text-align: center;">
            <div id="statusMessage" style="text-align: center; padding: 10px;"></div>
            <input type="submit" class="submit_form" value="FINALIZE TEAM" id="submit_button" />
            </div>
            </form>
        </body> 
    </html> 

  • Profile Image
    NeilVicente
    Answered on January 26, 2012 at 02:22 AM

    Sorry but JotForm does not allow custom scripts either. I think this question is related to another one of your questions which I have already answered.

    I am afraid that JotForm cannot exactly mimic what your former script used to do.

  • Profile Image
    zugfrig78
    Answered on January 26, 2012 at 03:25 AM
    Hi,
    Understand it can't be exactly mimicked but can anything be done in regards to using jot form tools.
    The most important thing to me is the preventing too many names being selected and knowing the order the names were selected in
    Either of these (preferably both) would be great
    The other parts about not choosing the same twice I can live without.
    I suppose the other question is, if embed a form in my website is it possible a additional third party script could also be present manipulating the behavior of the jot form script
    u