You are viewing limited content. For full access, please sign in.

Question

Question

How Do I Get User Input to Load into an HTML Message

asked on December 5, 2018 Show version history

Maybe this cannot be done.

I have a Form where the user must provide a PO #. Once the user does that, they must upload a PDF of the PO (not relevant to my story), then they click a radio button to Approve (at which time some text shows up). Within that text, I have 3 variables: PO #, CO #, and Vendor. The CO# and Vendor show up on the form because data was populated prior to form upload:

When using the poNo in the text didn't work, I created poNoForMessage and have it calculating =poNo. Even though it shows on the page, it's not set that it can be used in my message.

Thoughts?

BTW, the text shows up through a field rule:

0 0

Replies

replied on December 5, 2018

So the HTML tokens can (out of the box, on the first form) be used only in the second form (once the form is submitted in any way). There is a workaround! 
Look at this post - it helped me base one of my solutions on using the same concept of field input to replace things in the HTML block:

https://answers.laserfiche.com/questions/64063/Answer-Using-DIV-to-place-storeable-input-fields-into-HTML-text-blocks#82402

Let me know if you have questions!

 

1 0
replied on December 5, 2018

Thanks! I'll give it a try!

1 0
replied on December 6, 2018

What you provided is very cool but doesn't help me for this scenario because I want to leave the PO # where it is and just copy the PO # input to the HTML (sort of duplicating the info into a message). Rather than get fancy, I'm just going to reword my HTML text so I won't need it.

I appreciate the feedback though! Will probably use the info above in another form some day! Good to have in my bag of tricks!

0 0
replied on December 6, 2018 Show version history

Gloria,

Variables cannot be used that way in custom HTML so you have two options

  1. Populate the text with JavaScript (the exact approach depends on whether or not you need the text saved on the final form).
  2. Use a read-only field instead of Custom HTML
    • Use CSS to hide the label, border, etc., so it just looks like plain text.
    • Write a Function/Formula that will combine the base text with the values from the target fields.
2 0
replied on December 6, 2018

So I used the method above to put in the value of my field (entered in at the top of the form) into the HTML :) While this does have an input field in HTML you don't have to do that, you can just replace something with something too.

If you are still wanting to do that, I will show you my code and an example of what you need. Let me know :)

0 0
replied on December 7, 2018

Would love to see it!

0 0
replied on December 7, 2018 Show version history

I setup a simple form that kind of matches yours:

Please note that "CN" and the "PN" are only acting as placeholders and you can put anything in their place including just a white spaces. The Javascript code replaces anything between the > and <.

Here is the HTML:

I had to use "span" instead of "div" because span allows for no breaks even for nested sections (simply explained haha).

 

The CN field is Field 2 aka #q2 input, and the PN field is Field 3 aka #q3 input.

 

Javascript:

$(document).ready(function () {


//When the Field two receives input, it will replace the HTML placeholder 
  $("#q2 input").change(function(){
   
    var value = document.getElementById('Field2').value;
    document.getElementById('CN').innerHTML=Field2.value;
   
 });
  
  $("#q3 input").change(function(){
   
    var value = document.getElementById('Field3').value;
    document.getElementById('PN').innerHTML=Field2.value;
   
 });
  
  
});

So here is the final example:

you can see it replaced the "CN" with "1234". This is a super simple example you can build upon to fit your needs. And add the Field Rule you mentioned :)

Let me know if you have any questions about it! I am happy to help

1 0
replied on January 10, 2019

@████████ @████████- just wondering if you were able to get your process working?

0 0
replied on January 10, 2019

I tried it quickly and couldn't get it to work. I went with a generic message instead because I didn't have the time to troubleshoot. Sorry.

0 0
replied on January 10, 2019

Sorry! If you want to get it to work I don't mind connecting with you over phone if you would like some help?

1 0
replied on May 10, 2020

I would like to get some help with this code

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.