Michael
Jamroom Team
Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo
Back to top
smith.kyle
CodeSmith
Joined: 27 Apr 2006
Posts: 22009
Location: Southern California
Back to top
Michael
Jamroom Team
Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo
Back to top
Michael
Jamroom Team
Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo
Posted: 05/14/09 19:46
here is a test script:
name: which_submit.php
place the file in the home jamroom directory
/which_script.php
Code <?php
// set up our included files
require_once('include/jamroom-include.inc.php');
// get our variables
$_post = getPostVars();
##################################
# WHICH SUBMIT BUTTON WAS CLICKED
##################################
if(isset($_post['submit_test'])){
print "<pre>";
//display all variables
//$i = get_defined_vars();
//print_r($i);
//display only the $_post variables
print_r($_post);
print "<pre>";
}
// Set up our page
jmHtmlBegin("Which Submit button was clicked?");
jmBodyBegin();
jmBeginForm('which_submit.php');
jrHtmlFormHiddenField('submit_test','test');
htmlPageSelect('header');
$dat[5999999]['title'] = '<input type="submit" name="myfirstbutton" value="myfirstbutton" /><input type="submit" name="mysecondbutton" value="mysecondbutton" />';
htmlPageSelect('row',$dat);
htmlPageSelect('footer');
jmSubmit('submit','','150px');
jmEndForm();
jmBodyEnd();
jmHtmlEnd();
?>
produces the output of:
Array
(
[jr_html_form_token] => 933c55ec
[submit_test] => test
)
regardless of which submit was pressed.
even if i uncomment the:
Code //$i = get_defined_vars();
//print_r($i);
which outputs ALL the set variables neither of the submit button's names or values are anywhere to be found.
could something in jamroom internals be stripping it?
--edit--
the flat php form does work.
Code print '<form enctype="multipart/form-data" action="which_submit.php" method="post" name="form"/>';
print '<input type="submit" name="myfirstbutton" value="Go!" />';
print '<input type="submit" name="mysecondbutton" value="Go!" />';
print '</form>';
if ($_REQUEST['myfirstbutton']) print "I SEE THE FIRST BUTTON";
if($_REQUEST['mysecondbutton']) print "I SEE THE SECOND BUTTON";
--edit edit--
found the problem: its this in the <form creation line.
Code onsubmit="lockFormSubmit(this)"
_________________ Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
smith.kyle
CodeSmith
Joined: 27 Apr 2006
Posts: 22009
Location: Southern California
Back to top
Michael
Jamroom Team
Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo
Back to top