Giter Site home page Giter Site logo

HTML about sweetalert2 HOT 4 CLOSED

sweetalert2 avatar sweetalert2 commented on May 11, 2024
HTML

from sweetalert2.

Comments (4)

limonte avatar limonte commented on May 11, 2024

Can you please give an example of using SA2 when custom HTML isn't working as expected.

from sweetalert2.

fcremo avatar fcremo commented on May 11, 2024
swal({  title: 'Confirm?',
        text:   '<textarea class="form-control" id="notes" placeholder="Notes"></textarea>',
        type: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        html: true,
        cancelButtonColor: '#d33',
        confirmButtonText: 'Si',
        cancelButtonText: 'No',
    },
    function() {
        alert('other ajax stuff');
    }
);

from sweetalert2.

limonte avatar limonte commented on May 11, 2024

You should use SA2 like this:

swal({  title: 'Confirm?',
        html:   '<textarea class="form-control" id="notes" placeholder="Notes"></textarea>',
        type: 'warning',
        showCancelButton: true,
        confirmButtonColor: '#3085d6',
        cancelButtonColor: '#d33',
        confirmButtonText: 'Si',
        cancelButtonText: 'No',
    },
    function() {
        alert('other ajax stuff');
    }
);

Here's the example from the documentation:

swal({
            title: 'HTML example',
            html:
              'You can use <b>bold text</b>, ' +
              '<a href="//github.com">links</a> ' +
              'and other HTML tags'
        }); 

from sweetalert2.

fcremo avatar fcremo commented on May 11, 2024

I see. I realize I filed a non-existing issue because I inadvertently looked at the documentation of t4t5/sweetalert and assumed the intended behavior was the same. I guess I should be dismissed with a RTFM then. I'm sorry :)

from sweetalert2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.