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

    Can I put a button on my form to go to a particular url

    Asked by NRCsupport on March 03, 2014 at 01:27 PM

    Is it possible to put a button on form, for the user to click on to go somewhere else?

    button
  • Profile Image
    JotForm Support

    Answered by Welvin on March 03, 2014 at 03:02 PM

    Hi,

    You can use either the Free Text HTML and Image field to add a button to your form that is hyperlink to a particular URL. You can use an image as your button or apply an HTML codes that creates a simple button, example:

    <button><a target="_blank" href="http://fb.com" rel="nofollow" >Click Me!</a></button>

    Example Form: http://www.jotformpro.com/form/40615485941963

    Let us know if you need any further assistance.

    Thanks

  • Profile Image

    Answered by NRCsupport on March 03, 2014 at 04:22 PM

    Thanks. Is there any way to make the href part be based partly on a field on the form? - something like "http://www.mywebsite.com?name=<field1>" where field1 is a field on the form.

    Cn you suggest where I can learn about the sections of an <a> tag.

  • Profile Image

    Answered by Carina on March 03, 2014 at 04:53 PM

    You can go to this site to learn more about anchor tag:

    http://www.w3schools.com/tags/tag_a.asp

     

    You can insert the text field in the area you wish to navigate and insert this code:

    <a name="field1"></a>

     

    And then add your button where you wish:

    <button><a target="_blank" href="#field1" rel="nofollow" >Click Me!</a></button>

    You can change the name of the green part. Also in this case you "navigate" in the same page.

    You can test here:

    http://form.jotformpro.com/form/40614961182958

    In this case the anchor is before the "email" field.

    Let us know if you need further assistance.

  • Profile Image

    Answered by NRCsupport on March 03, 2014 at 05:12 PM

    Thanks. I don't think that quite answers my question. I want to be able to go to another web page, but part of the url string is effectively dynamic. It is either set by a field entered into this form, or (more likely) set from a "dummy" field that was filled from the url parameters when the current form was opened. In either case it is only known at the time that the form is in use, but not when the form is being designed.

  • Profile Image
    JotForm Support

    Answered by EltonCris on March 03, 2014 at 05:43 PM

    Hi,

    Thanks.

    I'm sorry but that's not possible currently. We do not have that feature yet. A workaround is to place the hyperlink code on your form thank you message. So when the form is submitted, the href URL will be populated with a URL that was entered on the form.

    Example:

    <button><a target="_blank" href="{websiteURL}" rel="nofollow" >Click Me!</a></button>

    Where {websiteURL} is a field variable from where the URL will be taken.

    Let us know if we can be of further assistance.

    Regards!

  • Profile Image

    Answered by NRCsupport on March 03, 2014 at 06:21 PM

    Thanks. I'll try that. It could do what I want.

    In connection with what I am trying to do, can a form discover its own FormID? Obviously I can hard code the ID into it, but I'd like to create something which I could use in other forms without having to hard code it each time.

  • Profile Image
    JotForm Support

    Answered by jonathan on March 03, 2014 at 06:57 PM

    Hi,

    In connection with what I am trying to do, can a form discover its own FormID? 

    I am not sure how you meant to use this. Can you please provide us more details. 

    You can create a new separate post for this also. Provide as much details as you can.

    And we will attend to it as soon as we can.

    Thanks!

  • Profile Image

    Answered by NRCsupport on March 04, 2014 at 05:57 PM

    Going back to message from EltonChris, three messages back in this thread. My Website URL is actually meant to be the same as your edit_link. But cannot be sent whole to my thankyou page because it contains ? and &. So my idea is to send FormID and SubmissionID as parameters in the url sent from the form to the thankyou page.

    So doyou think this would work?

    <button><a target="_blank" href="http://submit.jotformpro.com/form.php?formID={FormID}&sid={SubmissionID}&mode=edit" rel="nofollow" >Click Me!</a></button>

  • Profile Image
    JotForm Support

    Answered by TitusN on March 04, 2014 at 08:36 PM

    Hello,

    It would not work, you would have to put in the formID number itself rather than the variable tag.

    You will find the form ID number in the URL field of your browser when the form is opened for filling/editing.

    FormID as a variable will not return a result.

    The rest of the link is fine.

    Let us know if you hit a bump.

  • Profile Image

    Answered by NRCsupport on March 05, 2014 at 06:01 PM

    Re FormID.

    Yes, I was planning to put the FormID into a field on the form (as the default value for the field), and then pass it to thankyou page as part of theurl. The thankyou page would include the code above, and presumably should be able to pick the FormID I've sent to it.

    This would mean that I would only have to put the actual FormID in one place on the form, and it would be available wherever I need it in the thankyou page and the emails.

  • Profile Image
    JotForm Support

    Answered by TitusN on March 05, 2014 at 06:04 PM

    Yes, it would.

    Or just type out the actual form ID number on the thank-you page.

  • Profile Image

    Answered by NRCsupport on March 07, 2014 at 06:35 PM

    I must be doing something wrong, or maybe I've misunderstood what can be done. I believed that incuding a field name within {} in an html text field, the field value would be inserted instead of the bracketed field name.

  • Profile Image
    JotForm Support

    Answered by ashwin_d on March 07, 2014 at 09:40 PM

    Hello NRCsupport,

    Yes if you have a form field name as {formID} and that is inserted in the thank you page, it will insert the values. 

    Example:

    In this form: http://form.jotformpro.com/form/40654048845964?

    I have added a field as "Form ID" (hidden) and used this field to insert the value in hyperlink of thank you page. Please take a look at the above form and see if this is what you want to achieve.

    Thank you!

  • Profile Image

    Answered by NRCsupport on March 08, 2014 at 02:20 AM

    I think the mist is beginning to clear - and no doubt I've already been told this. I have just realised that you are doing it in the standard edited thankyou page. I am trying to do it in another jotform form which I use as my external thankyou page.

    So is this parameter substitution only available within a standard thankyou page, and not within a form itself?

    I need to use an external thankyou page because

    (a) I want it to have my website's normal page heading and navigation bar

    (b) I need to tailor what appears on the thank you page acording to some of the inputs in the original form. I pass these inputs to my thankyou form in the url.

  • Profile Image
    JotForm Support

    Answered by EltonCris on March 08, 2014 at 04:34 AM

    Going back to your previous question, like my colleague has said, you have to write the formID instead of the variable. There is no constant formID variable except for the submissionID as far as I know.

    It should then look like this:

    <button><a target="_blank" href="http://submit.jotformpro.com/form.php?formID=12345678901234&sid={id}&mode=edit" rel="nofollow" >Click Me!</a></button>

    12345678901234 -> replace with your actual formID

    {id} -> is the constant submissions field variable.

    ----

    You can use external custom thank you page and be able pass form values with HTTP POST. Guide: http://www.jotform.com/help/213-Send-POST-Data-From-JotForm-Using-PHP-in-Custom-Thank-You-Page

    Thanks!

  • Profile Image

    Answered by NRCsupport on March 08, 2014 at 09:45 AM

    Yes, I understand that. But I have a hidden field in my original form, called formID. I preset it to contain the actual form ID and pass it in the url to my thankyou page which is also a JotForm form. I also pass it the submission ID. The thankyou page has appropriately named hidden fields in which these are placed, and I have confirmed that they are there.

    If I edit your thankyou page, I can put field names in {} within the html code, and they are replaced at run time by the field contents. BUT in my own thankyou page they are not substituted, and remain as names enclosed in {}.

    If I use the post data method, will I be able to get parameter fields replaced by the field contents in my html, and if so how do I do it? I can't see the benefit of using the post data method when the target is another JotForm.

  • Profile Image

    Answered by Cesar on March 08, 2014 at 11:25 AM

    Im not sure if I follow your current workflow. From my understanding, you are submitting a form but what to post Form1 fields on Form2''s thank you page?

    That would not be possible, As the fields will only be populated on the actual forms thank you page. Like my colleagues I also advice to to insert the form id instead of passing it through form field {} code.

    You can pass values from one form to the other utilizing the Post method instructed on this guide:

    Send-POST-Data-From-JotForm-Using-PHP-in-Custom-Thank-You-Page

     

    Thank you

  • Profile Image

    Answered by NRCsupport on March 08, 2014 at 02:18 PM

    But apart from this problem, I have had no problem passing parameters in the URL.

    Yes, I could code the form ID directly, but that won't help because I cant get the submission ID to work either.

    What I am trying to achieve is roughly this sequence:-

    1. User submits Form1 which uses a thank you page which is itself a form (Form2)

    2. Form2 receives various parameters via the URL, and uses these parameters to decide exactly what to display.The parameters get stored in hidden fields from where their values can be tested.

    3. The parameters passed this way include FormID and SubID. These are passed and saved correctly. Form2 includes a clickable link which can be used to do an immediate edit on the original Form1. So Form2 needs to build the equivalent of edit_link using the FormID and SubID values. (The reason for wanting this is so that the user can check/alter their entry, even if they cannot access their emails on the computer where they are submitting the form)

    So I need the html code which I use to create this link to be able to replace {FormID} and {subID} by the content of those fields.

    This works when editing your editable thankyou page, but does not work in my own thankyou form. If I used the post-data method, would the data be available in Form2 in a way that could be automatically inserted in place of the names in the html code?

    Even if I hard code the FormID, I still need to get the submission ID value inserted.

    Do you have any examples of a form using parameters received by the post-data method?

  • Profile Image

    Answered by Cesar on March 08, 2014 at 03:43 PM

    To perform such workflow you will need to have a bridge with the right functions between both forms PHP file As you will not be able to pass through values directly from one form to the next.

    The guide: Send-POST-Data-From-JotForm-Using-PHP-in-Custom-Thank-You-Page

    Has two example forms at the bottom of the guide. Kindly take a look at these. Do let us know if you need further assistance on this. Thank you.

  • Profile Image

    Answered by NRCsupport on March 08, 2014 at 04:24 PM

    Well that looks exactly the same as doing by inserting the parametersin the URL myself, which is much simpler and does not need a seperate php file.

    But it still does not answer the main question three message back, i.e. "If I use the post data method, will I be able to get parameter fields replaced by the field contents in my html, and if so how do I do it?"

    I can quite successfully pass parameters to the second form, where they are stored in named fields, just like form2 in the example. But is there a way to get the contentsof these fields inserted into my html, as there is in your edited standard thankyou page?

  • Profile Image

    Answered by Cesar on March 08, 2014 at 05:22 PM

    To be clear, you want to prepopulate a form that is embedded on a website. Is that correct?

    As discussed on this thread: Prepopulating-embedded-form

    Prepopulation will not be possible through forms embeded to a webpage using iframe. On the other hand, if the standard embed code is used it may be possible to prepopulate, keep in mind that script conflicts will become a point of faliure if that method is used.

    Example of a form embedded to html using <Script> and prepopulating the field:

    https://shots.jotform.com/cesar/screens/jotformexamples/prepopulatesembedscriptcode.html?name=hello

  • Profile Image

    Answered by NRCsupport on March 08, 2014 at 06:13 PM

    No,sorry. I am quite successfully getting parameters into the thank you form. What I can't work out is whether I can get any of those parameters into an html field in that form.

    In an earlier message in this thread, Ashwin said

    ---- Yes if you have a form field name as {formID} and that is inserted in the thank you page, it will insert the values. 

    Example:

    In this form: http://form.jotformpro.com/form/40654048845964?

    I have added a field as "Form ID" (hidden) and used this field to insert the value in hyperlink of thank you page. Please take a look at the above form and see if this is what you want to achieve. ------

    This does what I want, but it is in an edited thankyou page of the form, not in an external form. But the same technique does not seem to work in an external form

  • Profile Image
    JotForm Support

    Answered by EltonCris on March 08, 2014 at 07:26 PM

    @NRCsupport 

    My colleague Ashwin's solution is only application on Jotform's Custom Thank you Message. Jotform's thank you message has special scripts that replaces variable tags with its real values once the form is submitted. This is why it works within the Jotform boundary. Since you are using external thank you page, the only way to pass form data is to enable HTTP POST on your form. Your thank you page must have PHP scripts that captures data from the form. Please refer to the previous guides about Send Post Data.

    Example external thank you page with the following PHP to post the edit URL:

    <?php

    $id = $_POST['submission_id']; //capture submission ID

    $formID = $_POST['formID'];  //capture form ID

    ?>

    <html>

    <head><title>Thank you!</title></head>

    <body>

    <H1>Hello! here's your edit URL</h1>

    <a target="_blank" href="http://submit.jotformpro.com/form.php?formID=<?php echo $formID; ?>&sid=<?php echo $id; ?>&mode=edit">Click Here to edit your existing data</a>

    </body>

    </html>

    Hope this helps. Thank you!

  • Profile Image

    Answered by NRCsupport on March 09, 2014 at 09:13 AM

    Thanks, that really lookslike what I want. But the thankyou page is also a JotForm form, and sadly the form editor seem to strip out those <?php parts. Is there any way of getting the bits of php script into a JotForm form?

  • Profile Image
    JotForm Support

    Answered by jonathan on March 09, 2014 at 09:53 AM

    Hi,

    Is there any way of getting the bits of php script into a JotForm form?

    I am sorry, but there is no means to do that within the form builder.

    If you want to influence the form(behaviour,functions) using your own custom code, you will really have to do it outside the form builder by using the form's source code.

    Should you have further input to this new topic, may I please suggest you create a different new thread about it.

    Thanks.

  • Profile Image

    Answered by NRCsupport on March 09, 2014 at 05:18 PM

    I've just had a bright idea which, amazingly, appears to work. My thsnkyou page is itself a JotForm  form. I have added a submit button to it, labelled it Edit Submission, and set the Thankyou URL to http://submit.jotformpro.com/form.php?formID={formid}&sid={subid}&mode=edit.

    This works nicely, and does go back in to edit the original submission. The only drawback I've seen so far is that of course it makes an extra submission (of the thankyou form). I don't think this facility will be used a great deal, so it should not add too many submissions to our account.

    It gives rise to a couple of questions which I'll put into a new thread.

  • Profile Image
    JotForm Support

    Answered by jonathan on March 09, 2014 at 07:23 PM

    Thank you for sharing your idea to us. We will attend to your new post about it as soon as we can.

    regards,