Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating a html form input with the 'html-output' in php #176

Open
guymclaren opened this issue Jun 7, 2019 · 1 comment
Open

Creating a html form input with the 'html-output' in php #176

guymclaren opened this issue Jun 7, 2019 · 1 comment

Comments

@guymclaren
Copy link

guymclaren commented Jun 7, 2019

I have looked and tried to find the answer to my question, read all the issues, read me file and I don't seem to find anywhere that tells me how I can create a variable in php with the data?

$htmltxt = $_REQUEST['pout'];

<input type="hidden" name="pout" value="html-output">

I understand php better than javascript, how do I send html-output to the form or how do I request it from php?

Answers would be helpful and adding this info to the readme file will be immensely useful.

If anyone wants to supply the answers I will even write the how to...

Thanks and Regards
Guy

@ghost
Copy link

ghost commented Aug 15, 2019

I had the same problem. I used post, not REQUEST, because I don't know REQUEST. Here is my solution:

Remove this in edit.html

  <script>
      var editor = window.pell.init({
        element: document.getElementById('editor'),
        defaultParagraphSeparator: 'p',
        onChange: function (html) {
          document.getElementById('text-output').innerHTML = html
          document.getElementById('html-output').textContent = html
        }
      })
    </script>

and add this:


  <script>
      var editor = window.pell.init({
        element: document.getElementById('editor'),
        defaultParagraphSeparator: 'p',
        onChange: function (html) {
          document.getElementById('text-output').innerHTML = html
          document.getElementById('html-output').textContent = html
          document.getElementById('html-output2').textContent = html
        }
      })
    </script>
form action="NAMEOFYOURPHPFILE" method="post">
<input name="content" type="hidden" id="html-form">
</form>

NAMEOFYOURPHPFILE is the name of your php file.

(Sorry for bad English)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant