default value

  • Profile Image
    sergio56
    Asked on February 06, 2012 at 05:41 PM

    Hi,

    i need a form with a default value equal to one other form value.

    exemple: = (form 1 value) & (form 2 value).. 

    The values are text, not calc.

    Is it possible?

    thanks

  • Profile Image
    abajan
    Answered on February 06, 2012 at 06:13 PM

    Let me be sure I understand you. Would both text inputs be in the same form or different ones? In other words, did you mean "... equal to one other form's value" when you stated "... equal to one other form value"? If the inputs are in the same form, JavaScript would have to be included in an edited version of the form's full source. Conversely, if the inputs exist in different forms, the second form's input can be pre-populated with the entry made in the first form's input via a link displayed in the "Thank You" message and/or an email alert.

    Looking forward to hearing from you again.

  • Profile Image
    sergio56
    Answered on February 06, 2012 at 06:30 PM

    excuse me,

    i commised one error: i'm talking about field but not form

    example:

    field 1 : 'toto'

    field 2 : 'tata'

    > field 3= 'tototata' 

    how can i access to the edited version of the form's full source?

    thanks

  • Profile Image
    abajan
    Answered on February 06, 2012 at 06:47 PM

    Thanks for the clarification. You would first have to get the form's source code from the Embed Form Wizard (Setup & Embed tab > Embed Form) and then it would have to be edited accordingly. I'll see if I can provide you with the JavaScript and other necessary changes to the code later.

  • Profile Image
    abajan
    Answered on February 06, 2012 at 10:29 PM

    The simple form on this page demonstrates the functionality you want.

    So how was it done?

    1. The form was constructed in the form builder and its source code copied from the Embed Form Wizard and pasted into the web page

    2. Just before the closing body tag of the page, a JavaScript function was inserted

    3. An onFocus event handler calling the function was placed within the input tag of the third text box


    A Brief Explanation of the Function

    document.getElementById("input_5").value is the value of the 3rd text box's input

    document.getElementById("input_3").value is the value of the 1st text box's input

    document.getElementById("input_4").value is the value of the 2nd text box's input

    Whatever is on the right of the equals sign is calculated (in this case, combined with the use of the "+" operator) and the result assigned to the variable on its left. So, when the function is called (by its name: combineEntries) via the event handler, it combines the values (user entries) of the 1st and 2nd text boxes and displays the result in the 3rd text box. 

    It's not the best explanation in the world but I hope it helps to clarify things a bit. If you view the source of the demo page, you'll see the changes to the form's code described in Steps 2 and 3 above.

  • Profile Image
    sergio56
    Answered on February 11, 2012 at 08:51 PM

    Thank you for your answer.

    i understand all but my problem is : can i change my jotform code without have to paste code into web page? (my web page uses only jotform form url)

    Thanks

  • Profile Image
    abajan
    Answered on February 11, 2012 at 09:00 PM

    No, this particular solution requires that the code be pasted into a web page. If you don't have a website, we can recommend various hosting solutions for the form.

  • Profile Image
    sergio56
    Answered on February 11, 2012 at 09:08 PM

    yes please.

    Thanks

  • Profile Image
    abajan
    Answered on February 12, 2012 at 06:28 PM

    Try the following: AwardSpace.com or AtSpace.com

    From my experience, their servers are hardly ever down. (I think they're affiliated with each other.) Others users of our forum will likely be able to recommend other hosting options for you.