• Resolved wpdia

    (@wpdia)


    How can i hide the jquery with fieldname data in HTML code ?

    It shows the original code in HTML code When i copy below Jquery codes to Field Type: HTML content .

    <script>
    function silentSubmission(e)
    {
    $(".submit").click(function(){
    $(".display-message-here").append("<table><tr align='center'><td>"+jQuery('[id*="fieldname26_"]').val()+"</td></tr></table>");
    });
    }
    </script>

    Here is the screenshot : demo screenshot

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @wpdia,

    In this case you can pass the value of the field directly as a second parameter of the silenSubmission function:

    
    function silentSubmission(e,v)
    {
    $(".submit").click(function(){
    $(".display-message-here").append("<table><tr align='center'><td>"+v+"</td></tr></table>");
    });
    }
    

    Best regards.

    Thread Starter wpdia

    (@wpdia)

    @codepeople

    could you guide me how to do it ? Many thanks

    • This reply was modified 7 years, 6 months ago by wpdia.
    Plugin Author codepeople

    (@codepeople)

    Hello @wpdia,

    Where are you calling the silentSubmission function? In the code where the function is called you should read the value of the field and pass it to the function as the second parameter.

    Actually, there are multiple alternatives,for example, if you creates the content of the tag with the class name: .display-message-here from an equation, and you include to the class definition the css rule:

    display:none;

    Then, you only should show the tag when the button be pressed:

    
    function silentSubmission(e)
    {
    $(".submit").click(function(){$(".display-message-here").show();});
    }
    

    If you need that I implement your project, do not hesitate in contact me through my private website:

    https://cff.dwbooster.com/customization

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘How can i hide the jquery code with fieldname data in HTML code ?’ is closed to new replies.