• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Google Tabellen,Eingabe Felder nach Eingabe lehren

Sorry, ich bin es noch mal. Ich habe mein Reset funkt noch mal etwas überarbeitet und habe dem ganzem ein optischer Rahmen gegeben, in dem ich eine On/Off flipswitches Funktion eingefügt habe leider weiß ich nicht, wie ich Ihre Lösung darin zum Laufen bringe
Code:
  <label>
       Autoreset ON/OFF:
       <input type="checkbox" id="reset-on">
       </label>

Code:
 <div class="onoffswitch">
    <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" tabindex=id="reset-on">
    <label class="onoffswitch-label" for="myonoffswitch">
        <span class="onoffswitch-inner"></span>
        <span class="onoffswitch-switch"></span>
 
Werbung:
Im Javascript verwenden wir die ID "reset-on", d. h. das HTML muss so aussehen:
Code:
    <div class="onoffswitch">
        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="reset-on">
        <label class="onoffswitch-label" for="reset-on">
        <span class="onoffswitch-inner"></span>
        <span class="onoffswitch-switch"></span>
 
Danke das ganze funktioniert ja schon mal recht gut nur leider spring nach jeder Eingab der Schalter von ON wieder auf OFF, wenn ich den Submit Button drücke
Code:
<body>
    <form id="itemForm" autocomplete="off">
        <label for="sku">SKU:</label>
        <br>
        <input type="search" id="sku" name="sku">
        <br>
        <label for="description">Description:</label>
        <br>
        <input type="search" id="description" name="description">
        <br>
        <label for="color">Color:</label>
        <br>
        <input type="search" id="color" name="color">
        <br>
        <label for="size">Size:</label>
        <br>
        <input type="search" id="size" name="size">
        <br>

        <div class="flex-container">
            <input type="button" value="Submit" onclick="submitForm()">
            <input type="button" value="Reset" onclick="form.reset()">
             </div>
             <label>
            
      <div class="onoffswitch">
        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="reset-on">
        <label class="onoffswitch-label" for="reset-on">
        <span class="onoffswitch-inner"></span>
        <span class="onoffswitch-switch"></span>
        </div>
       </label>
            
    </form>
    
    <script>
        function submitForm() {
            var form = document.getElementById('itemForm');
            var formData = {
                'sku': form.sku.value,
                'color': form.color.value,
                'size': form.size.value,
                'description': form.description.value
            };
            google.script.run.processForm(formData);
            // Prüfen ob das Formular zurück gesetzt werden soll:
            if (document.getElementById('reset-on').checked) {
                form.reset();
            }
        }
    </script>
 
Werbung:
Danke das ganze funktioniert ja schon mal recht gut nur leider spring nach jeder Eingab der Schalter von ON wieder auf OFF, wenn ich den Submit Button drücke
Code:
<body>
    <form id="itemForm" autocomplete="off">
        <label for="sku">SKU:</label>
        <br>
        <input type="search" id="sku" name="sku">
        <br>
        <label for="description">Description:</label>
        <br>
        <input type="search" id="description" name="description">
        <br>
        <label for="color">Color:</label>
        <br>
        <input type="search" id="color" name="color">
        <br>
        <label for="size">Size:</label>
        <br>
        <input type="search" id="size" name="size">
        <br>

        <div class="flex-container">
            <input type="button" value="Submit" onclick="submitForm()">
            <input type="button" value="Reset" onclick="form.reset()">
             </div>
             <label>
           
      <div class="onoffswitch">
        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="reset-on">
        <label class="onoffswitch-label" for="reset-on">
        <span class="onoffswitch-inner"></span>
        <span class="onoffswitch-switch"></span>
        </div>
       </label>
           
    </form>
   
    <script>
        function submitForm() {
            var form = document.getElementById('itemForm');
            var formData = {
                'sku': form.sku.value,
                'color': form.color.value,
                'size': form.size.value,
                'description': form.description.value
            };
            google.script.run.processForm(formData);
            // Prüfen ob das Formular zurück gesetzt werden soll:
            if (document.getElementById('reset-on').checked) {
                form.reset();
            }
        }
    </script>
 
Sorry ich habe den Fehler selber gefunden.Ich habe ausversehen die falsche Datei verwendet zum bearbeiten.betrachten sie den Thema als erledigt.So jetzt muß ich alles nur noch ein einer Flex Box alles in Reihe und Glied bringen.
 
Zurück
Oben