Snippets Collections
    <input type="file" name="doc_file" accept=".doc,.docx">
    <input type="file" name="image_file" accept="image/*">
/**
 * Plugin Name:       My Basics Plugin
 * Plugin URI:        https://example.com/plugins/the-basics/
 * Description:       Handle the basics with this plugin.
 * Version:           1.10.3
 * Requires at least: 5.2
 * Requires PHP:      7.2
 * Author:            John Smith
 * Author URI:        https://author.example.com/
 * License:           GPL v2 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Update URI:        https://example.com/my-plugin/
 * Text Domain:       my-basics-plugin
 * Domain Path:       /languages
 */
function myFunction() {

  const formTitle = "sample"; // This is a form title.

  const sheetName = "Sheet1"; // This is a sheet name.



  const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName);

  const [, ...values] = sheet

    .getDataRange()

    .getDisplayValues()

    .filter((r) => r.join("") != "");

  const obj = values.map(([a, b, c]) => {

    const answers = b

      .split("\n")

      .map((e) => e.trim())

      .filter(String);

    const correct = c

      .split("\n")

      .map((e) => e.trim())

      .filter(String);

    return {

      question: a,

      answers,

      correct,

      point: 1,

      type: correct.length == 1 ? "addMultipleChoiceItem" : "addCheckboxItem",

    };

  });

  const form = FormApp.create(formTitle)

    .setIsQuiz(true)

    .setTitle("Sample questions");

  obj.forEach(({ question, answers, correct, point, type }) => {

    const choice = form[type]();

    const choices = answers.map((e) =>

      choice.createChoice(e, correct.includes(e) ? true : false)

    );

    choice.setTitle(question).setPoints(point).setChoices(choices);

  });

}
<script>
  var Webflow = Webflow || [];
Webflow.push(function() {  
  // unbind webflow form handling (keep this if you only want to affect specific forms)
  $(document).off('submit');

  /* Any form on the page */
  $('form').submit(function(e) {
    e.preventDefault();

  	const $form = $(this); // The submitted form
    
    if ($form.valid()) {
      const $submit = $('[type=submit]', $form); // Submit button of form
    const buttonText = $submit.val(); // Original button text
    const buttonWaitingText = $submit.attr('data-wait'); // Waiting button text value
    const formMethod = $form.attr('method'); // Form method (where it submits to)
    const formAction = $form.attr('action'); // Form action (GET/POST)
    const formRedirect = $form.attr('data-redirect'); // Form redirect location
    const formData = $form.serialize(); // Form data
    
    // Set waiting text
    if (buttonWaitingText) {
      $submit.val(buttonWaitingText); 
    }
    
    $.ajax(formAction, {
    	data: formData,
      method: formMethod
    })
    .done((res) => {
      // If form redirect setting set, then use this and prevent any other actions
      if (formRedirect) { window.location = formRedirect; return; }

    	$form
      	.hide() // optional hiding of form
    		.siblings('.w-form-done').show() // Show success
      	.siblings('.w-form-fail').hide(); // Hide failure
    })
    .fail((res) => {
      $form
      	.siblings('.w-form-done').hide() // Hide success
    	  .siblings('.w-form-fail').show(); // show failure
    })
    .always(() => {
      // Reset text
      $submit.val(buttonText);
    });
    }
  });
});
</script>
<input type="checkbox" name="animal[]" value="Cat" />
<input type="checkbox" name="animal[]" value="Dog" />
<input type="checkbox" name="animal[]" value="Bear" />

<?php

if ( isset( $_POST['animal'] ) ) {
    foreach ( $_POST['animal'] as $animal ) {
        echo $animal;
    }
}

?>
/*CSS*/
.field-item__wrapper {
    position: relative;
    padding-top: 15px;
}
.form__field {
    font-family: inherit;
    width: 100%;
    border: 0;
    border-bottom: 2px solid #000;
    outline: 0;
    color: #000;
    padding: 7px 0;
    background: 0 0;
    transition: border-color 0.2s;
}
.form__field::placeholder {
    color: transparent;
    opacity: 0;
}
.form__field:placeholder-shown ~ .form__label {
    cursor: text;
    top: 20px !important;
}
.form__label {
    position: absolute;
    top: 0;
    display: block;
    transition: 0.2s;
    color: #000;
}
.form__field:focus {
    padding-bottom: 6px;
    border-width: 3px;
    border-image-slice: 1;
    border-color: #000 !important;
}
.form__field:focus ~ .form__label {
    position: absolute;
    top: 0 !important;
    font-size: 0.8em;
    display: block;
    transition: 0.2s;
}
.form__field:invalid,
.form__field:required {
    box-shadow: none;
}
.w-input.error {
    border-color: #cc3131;
}
label.error {
    font-size: 10px;
    line-height: 24px;
    color: #cc3131;
    position: absolute;
    bottom: -25px;
}
/*CSS*/
else if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)){
            $_SESSION['errors'][] = "Invalid email format!";   
        }
button:focus { /* Some exciting button focus styles */ }
button:focus:not(:focus-visible) {
  /* Undo all the above focused button styles
     if the button has focus but the browser wouldn't normally
     show default focus styles */
}
button:focus-visible { /* Some even *more* exciting button focus styles */ }
star

Tue Sep 06 2022 12:23:03 GMT+0000 (UTC) https://blog.miguelgrinberg.com/post/handling-file-uploads-with-flask

#html #form #uploadfile
star

Mon Aug 08 2022 04:46:18 GMT+0000 (UTC) https://developer.wordpress.org/plugins/plugin-basics/header-requirements/

#php #email #form #wordpress #header
star

Mon Jun 13 2022 16:28:04 GMT+0000 (UTC) https://tanaikech.github.io/2022/04/05/creating-quizzes-in-google-form-using-google-forms-service-with-google-apps-script/

#quiz #form
star

Tue Apr 05 2022 08:31:18 GMT+0000 (UTC) https://stackoverflow.com/a/6881058/3238619

#php #html #form
star

Sun Mar 20 2022 18:08:42 GMT+0000 (UTC) https://agency-website-c0d1e7.webflow.io/

#css #form
star

Sun Feb 20 2022 17:49:17 GMT+0000 (UTC) https://www.geeksforgeeks.org/how-to-handle-multiple-input-field-in-react-form-with-a-single-function/

#react #form
star

Tue Feb 15 2022 04:42:32 GMT+0000 (UTC)

#imageupload #form #html #php
star

Fri Feb 11 2022 00:06:31 GMT+0000 (UTC) https://www.w3schools.com/php/php_file_upload.asp

#imageupload #form #html #php
star

Wed Sep 08 2021 14:47:57 GMT+0000 (UTC) https://css-tricks.com/keyboard-only-focus-styles/

#css #a11y #form #button

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension