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 8692161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:15:53+00:00 2026-06-13T00:15:53+00:00

I already have this script <FORM method=POST name=ajax action=#> <INPUT type=submit class=env_buttn value=<?php echo

  • 0

I already have this script

<FORM method="POST" name="ajax" action="#">  
<INPUT type="submit" class="env_buttn" value="<?php echo "Generate"; ?>"            
ONCLICK="gen_data()">
<div id="data_gen"> 
    // generated html to be sent to check.php
 </div>
 </FORM>

What I want to do is send the generated html in the div to another php script check.php .
I’ve thought of adding another button but I don’t know how to do it properly. Any ideas ?

  • 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-13T00:15:54+00:00Added an answer on June 13, 2026 at 12:15 am

    To get html from inside an element do this in javascript:

    var html = document.getElementById('data_gen').innerHTML
    

    So that’s part of your question answered at least… What do you want to do with the html?

    Assuming you want to do ajax style stuff… just add this function to an onclick event for a button:

    function event_calls_this()
    {
        var html = document.getElementById('data_gen').innerHTML;
        jQuery.ajax(
        {
            url       : 'blah/check.php',
            data      : {the_html:html},
            type      : 'POST',
            success   : function(data)
            {
                //do what you need to do with the response
            }
        }
    }
    

    One question that springs to mind is: What are you actually trying to do? Does the user somehow fill in the div? If yes then how? I’m pretty certain that changing your strategy would yield a more elegant solution but I’m unsure of the specifics… so, if this doesn’t solve your problem, can you give us some background info?

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

Sidebar

Related Questions

I have form: <form method='post' action='script.php'> <textarea id='main' name='text'></textarea> <input type='hidden' name='id' value='1'> <input
I have this form: <form name=commentform id=commentform action=comment.php method=post enctype=multipart/form-data> Your Name: <textarea maxlength=60
I have this input in a form: <input type=text value=<script src='/js/script.js' type='text/javascript'></script> name=embed/> The
Say there is a form: <form enctype=multipart/form-data method=post> <input name='foo'> <input name='foo'> <input type=submit>
If i have something like: <form method=post id=customForm action=> //stuff <div id=copiar> <button class=button
I have already download and install this package to support HTML5 input type http://support.microsoft.com/kb/2468871
I already have a form with normal HTTP post. Now, I want to rewrite
I already have this issue but I cannot remember how to solved it. (I
I have already have this code to force these URLs to HTTPS: RewriteCond %{HTTPS}
I'm sure others have already asked this, but is it possible to insert an

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.