Alert box

  • Profile Image
    shproperties
    Asked on March 13, 2013 at 11:50 AM

    Is it possible to add an alert/pop up box within the form?

     

    For e.g,

     

     

    <FORM>

    <INPUT TYPE="button"  VALUE="ORDINARY BUTTON" 

    onClick='alert("Yes, this is an alert box with a message for your visitor!")'>

    </FORM>

     

    Can't seem to manage it

  • Profile Image
    ardy0689
    Answered on March 13, 2013 at 12:06 PM

    Yes this is possible but unfortunately it is out of scope in terms of function in JotForm. You can do this via Javascript or any Javascript library such as jQuery, Prototype and MooTools.

    For example:

    <FORM>

    <INPUT TYPE="button"  VALUE="ORDINARY BUTTON" ID="input1">

    </FORM>

     

    Your jQuery code can be like this:

    $(document).ready(function(){
      $("#input1").click(function(){
        alert("Yes, this is an alert box with a message for your visitor!")
      });
    });

     

    If you have further inquiries, please do not hesitate to ask. Thanks

  • Profile Image
    shproperties
    Answered on March 13, 2013 at 12:09 PM

    So, what do I actually put into the Form?

  • Profile Image
    sidharth_kch
    Answered on March 13, 2013 at 12:35 PM

    @ shproperties

    You need to download the source code of your form and implement the changes manually.

    Refer this guide on how to download source code.

    Feel free to contact us if you need any help in customization of your form.

    Thanks,

    Sidharth

  • Profile Image
    ardy0689
    Answered on March 13, 2013 at 01:27 PM

    In addition, to downloading the source code you, you will going to embed the source code along its files(CSS+JS).

    In order to achieve this, assuming that the button has an ID of "input1", then next thing that you should do is to attach the script at the last line of the <head> tag.

    <head>

    <title>Some title</title>

    ......some .css links

    .......some .js links

    <script type="text/javascript">

    $(document).ready(function(){
      $("#input1").click(function(){
        alert("Yes, this is an alert box with a message for your visitor!")
      });
    });

    </script>

    </head>

     

    Basically, this is just a general idea and only to show you how it should be implemented. It may or may not work depending on your goal. 

    Thanks