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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:59:42+00:00 2026-05-30T09:59:42+00:00

This should be an easy fix for the right guru! Everything is working for

  • 0

This should be an easy fix for the right guru! Everything is working for me except that I can’t get this form to submit without clicking the submit button. The data values are all valid. The action page, …gdform.php, uses $_post to get the “redirect” value from the form and then uses php to do a header Location change. That works fine if I execute the form with the submit button. I just need it to happen without any click…
Take a look, please!

<?php session_start();
require_once('Connect.php') ;
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Nitrofill Document</title>

<?php
//error_reporting(E_ALL);
$sn=$_GET['num'];
echo $sn;

mysql_connect($hostname,$username, $password) OR die('Unable to connect to database! Please try again later.');
mysql_select_db($dbname);
 $selectSQL = "select * from `Presentations` where `serialnum` ='" . $sn ."'" ;

$result = mysql_query($selectSQL) or die(mysql_error());
$row = mysql_fetch_array($result,  MYSQL_BOTH);
$thedoc = urldecode($row['docurl']);
$therecip=urldecode($row['recipient']);
$thetracker=urldecode($row['tracker']);
$lastacc=urldecode($row['last_accessed']);

?>
</head>
<body>

<form id="notice" action="http://m3sglobal.com/gdform.php" method="post"> 
<input  name="subject" value="<?php echo $therecip . " has viewed the document you sent them.";?> " /> 
<input type="hidden" name="redirect" value="<?php echo $thedoc ; ?>"/>
<label>Email:</label><input type="text" name="email" value="<?php echo $thetracker ; ?>"/>
<label>Comments:</label><textarea name="comments" cols="40" rows="5">
Document Viewed:<?php echo $thedoc ; ?>

When Accessed:<?php echo $lastacc ; ?>
</textarea>
<input type="submit" name="submit"/>
</form>
</body>

</html>
<script type="text/javascript">

 $(document).ready(function(){
   myfunc
 });

function myfunc () {
var frm = document.getElementById("notice");
frm.submit();
}

</script>
  • 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-05-30T09:59:44+00:00Added an answer on May 30, 2026 at 9:59 am

    I might be wrong but shouldn’t it be: (corrected typos)

    $(document).ready(function(){
       myfunc(); <--// with ();
    }); 
    
    function myfunc() {  <--// without space
        var frm = document.getElementById("notice");
        frm.submit();
    }
    

    or better yet:

    $(document).ready(function(){
       $("form#notice").submit();
    });
    

    EDIT:

    Prowla is right, you also didn’t declare the jQuery library. Good catch Prowla, I missed that, just saw the typos.

    EDIT #2:

    Your code is pretty messy there, and you have that PHP generated string in the <head>. Also your submit had no value, you used name. I cleaned it up, here is working code (for me at least):

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Nitrofill Document</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
        <script type="text/javascript">
        $(document).ready(function(){
            $("form#notice").submit();
        });
        </script>
    </head>
    <body>
    <!--// ALL THE PHP SHOULD GO HERE TO MAKE THE URL BELOW //-->
    qyO452ZKphttps://docs.google.com/presentation/pub?id=1chxqg-qjrfEvAR9_Jia7lt4ps2_Q7IfTiI41bQE7Q_4&start=true&loop=false&delayms=3000<br/>greg.mcgee@gmail.com<br/>greg.mcgee@advetel.com<br/>Thu, 23 Feb 2012 19:42:11 MST<br/>
    <!--// END PHP //-->
    
    <form id="notice" action="http://m3sglobal.com/gdform.php" method="post"> 
        <input name="subject" value="greg.mcgee@gmail.com has viewed the document you sent them. " /> 
        <input type="hidden" name="redirect" value="https://docs.google.com/presentation/pub?id=1chxqg-qjrfEvAR9_Jia7lt4ps2_Q7IfTiI41bQE7Q_4&start=true&loop=false&delayms=3000"/>
        <label>Email:</label><input type="text" name="email" value="greg.mcgee@advetel.com"/>
        <label>Comments:</label><textarea name="comments" cols="40" rows="5">
            Document Viewed:https://docs.google.com/presentation/pub?id=1chxqg-qjrfEvAR9_Jia7lt4ps2_Q7IfTiI41bQE7Q_4&start=true&loop=false&delayms=3000
            When Accessed:Thu, 23 Feb 2012 19:42:11 MST
        </textarea>
        <input type="submit" value="submit"/>
    </form>
    </body>
    </html>
    

    You might want to consider using firebug to help you troubleshoot your pages. Its how I figured this out. Also remember Prowla’s advice, and protect your SQL.

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

Sidebar

Related Questions

This is something that should be easy to answer, but is more difficult for
This seems like it should be an easy fix, but after searching for hours
This should be easy for many of you, but for me it's just another
This should be easy, but I'm not sure how to best go about it.
This should be easy, just curious. I know httpd is the HTTP daemon, just
This should be easy (at least no one else seems to be having a
I think this should be easy, but it's evading me. I've got a many-to-many
OK, I'm feeling like this should be easy but am obviously missing something fundamental
This should be an easy one. I have a table like so: <table> <tr>
This should be an easy problem but... I need to format a currency for

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.