What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    How can I add a custom button

    Asked by lampo on November 16, 2011 at 02:33 PM

    Hi 

    I'm looking to add a custom button to my form and i'm not sure how

    To give you a brief explanation of what i'm tring to accomplish, I have a form that is used to log times of patient collections and instead of the user having to type in each time, I would like them to be able to just click a button and have the form register the time into the textbox instead.

    I have looked at examples on the web and have gotten them to work without issue, but if i copy the button code and javascript into my form source code, the button shows up but nothing happens when it is clicked.

    My HTML isn't the best (as you can probably tell), so please bear that in mind when it comes to answers :)

    also, the data that this form will be logging is fairly sensitive information, so i'd like to keep this form as secure as possible, I assume the https:// before www.jotform.com/"my form" is the way to go

     

    thanks in advance for any help

    Screenshot
  • Profile Image

    Answered by fxr on November 16, 2011 at 07:41 PM

    On your first issue, can you provide me with the javascript / button that you were trying to integrate into your form? and also what you exactly you want it to do. We can certainly have a look to see if its anyway possible to add it to your form.

    As regards, secure URLs for your forms, https://www.jotform.com/form/'myform' or https://secure.jotform.com/form/'my_form' are used for SSL forms. 

  • Profile Image

    Answered by lampo on November 17, 2011 at 03:06 PM

    sorry for the double post, it turned my answer into html when i edited my post

     

    Here is the code that i have used

    <html>
    <head>
    <title>(Type a title for your page here)</title>
    <script type="text/javascript"> 
    function show_now() { 
    var my_time = new Date();
    alert(my_time); 
    }
    </script>
    </head> 

    <body> 
    <input type=button value="Show Time" onclick="show_now();"> 
    </body>
    </html>

    and it's from this website&nbsp;http://www.plus2net.com/javascript_tutorial/date.php

    i have removed the tags that i didn't need e.g. , etc. and inserted the function and button code into the source code of my form, in the and sections, but as i said, the button appears but does nothing when clicked

    What i want is the user to click the button, and for it to input the current time into a text box.

    I realise that the code above doesn't do that, but if i could get it to work, at least it would get me started, and i can work from there to get the rest up and running

  • Profile Image

    Answered by fxr on November 17, 2011 at 07:15 PM

    What do you mean by the ' source code of my form' of your form? 

    have you downloaded the source code files and embedded them somewhere? if so, please provide a link.

    Also, link the form you are working on as well, please

     

    This should  be pretty straightforward (including the updating of your field), just need where your trying to implement this.

    Thanks.