Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8029849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:33:44+00:00 2026-06-05T00:33:44+00:00

I am trying to echo auto-generated html form elements, but the page always shows

  • 0

I am trying to echo auto-generated html form elements, but the page always shows html code as text. When I check the output via Chrome, it shows generated form input with quotes and whitespaces. Here is what I have tried and results:

Here is code generates entire form

<form action="<?php echo url_for('/survey/submit?id='.$Survey->getId()) ?>" method="post">
    <ul>
    <?php foreach($Questions as $Question): ?>
        <li><?php echo $Question->questionHtml() ?></li>
    <?php endforeach; ?>
    </ul>
</form>

And here is a sample result:

"<li>
                                <input class="survey" size="40" type="text" name="Sample Survey[input_1]" id="Sample_Survey_input_1" />             </li>"

I tried htmlentities also.

echo htmlentities($Question->questionHtml())
"
                                &lt;input class=&quot;survey&quot; size=&quot;40&quot; type=&quot;text&quot; name=&quot;Sample Survey[input_1]&quot; id=&quot;Sample_Survey_input_1&quot; /&gt;             "

The problem is I couldn’t get these generated form elements displayed on the page, but only plain text format of them.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T00:33:46+00:00Added an answer on June 5, 2026 at 12:33 am

    If its showing the code you need to decode the html entities

    echo html_entity_decode( $Question->questionHtml() );
    

    http://www.php.net/manual/en/function.html-entity-decode.php

    BUT

    This shouldn’t have to be done. The questionHtml() function should only turn the form values into their entities, not the entire form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to echo a result from xml into my html code form
im trying to echo mediaplayer embed code with IF statement. is there any way
I am trying to echo a javascript alert message in php but I am
I'm trying to echo a value in a form based on number of rows
I am trying to get the following code to work: if (isset($_POST['file'])){ if(file_exists($_POST['file'])){ echo
I'm trying to insert variables from an SQL result into a HTML form in
I am trying to pass form name dynamically. But this script is showing an
I'm trying to add the functionality to this dynamic order form that will auto
I'm trying to get the auto incremented column of a row. The code will
I trying to create a auto-complete search script (jQuery + PHP) but I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.