Page 1 of 1
Form Processing
Posted: Mon Feb 27, 2006 11:27 am
by inkubus08
Maybe i'm doing something wrong but with this example when the submit button is pressed name/value of the two buttons are not being passed with the post....the echo produces nothing...is there a way to make this scenerio work???any additional help would be wonderful...
<form method="POST" action="whatever this file name is">
<input type="button" value="TEMP" name="daaaa">
<input type="button" value="TEST" name="LOLOLOL">
<input type="submit" value="OMG">
</form>
<?php
$da = $_POST['daaaa'];
$lol = $_POST['LOLOLOL'];
echo $da.$lol;
?>
I need to have the value of each button available after the form has been submitted.
Posted: Mon Feb 27, 2006 11:32 am
by feyd
buttons clicked (and/or default submits) are the only ones transmitted with standard submissions. Maybe hidden values? Or an entirely different way? What's the goal you want? What are you trying to achieve?
Posted: Mon Feb 27, 2006 11:53 am
by inkubus08
If you go to
http://ncaa.picktowin.net/bracket.html you can see an example of what I am doing. User clicks a button and then copies its value to another button.....when the form is complete I need the values of all of the buttons so that they can be inserted into a MySQL database.
Posted: Mon Feb 27, 2006 12:30 pm
by a94060
can you jsut keep on passing the values on to each page?(i dont know if you are doing 1 physical script or multiple pages.)if you just kept on passing and then adding a new entry into your database. I think that would seem to work.
Posted: Mon Feb 27, 2006 12:35 pm
by feyd
The page you referenced is entirely controlled by Javascript.
Posted: Mon Feb 27, 2006 12:41 pm
by a94060
sory if i hijacked thread but wat do u mean by it is controlled by JS? i see it as all HTML with no Java tags.
Posted: Mon Feb 27, 2006 12:45 pm
by John Cartwright
a94060 wrote:sory if i hijacked thread but wat do u mean by it is controlled by JS? i see it as all HTML with no Java tags.
Not to be blunt, but did you look at the source code?
The first 150 or so lines is all javascript.. and is called based on events such as
Code: Select all
onClick="go(this.id,'1-15A',this.value);"/>
Posted: Mon Feb 27, 2006 1:13 pm
by inkubus08
http://ncaa.picktowin.net/bracket.html is just to show what i am trying to do...yes i use javascript to populate the other buttons on the form but once the form is complete i will use a php script to process the POST array to add the values into a MySQL database......ignore the fact that the link is to a .html file ....that was just to show what i am trying to do as far the form goes....i have seperate php files ....
http://ncaa.picktowin.net/bracket.php is the same form in a php file that calls for itself when submitted.....the button values are not being passed with the POST....how if at all could pass the button values to php for processing...any help would be great
Re: Form Processing
Posted: Mon Feb 27, 2006 2:15 pm
by a94060
inkubus08 wrote:Maybe i'm doing something wrong but with this example when the submit button is pressed name/value of the two buttons are not being passed with the post....the echo produces nothing...is there a way to make this scenerio work???any additional help would be wonderful...
Code: Select all
<form method="POST" action="whatever this file name is">
<input type="button" value="TEMP" name="daaaa">
<input type="button" value="TEST" name="LOLOLOL">
<input type="submit" value="OMG">
</form>
<?php
$da = $_POST['daaaa'];
$lol = $_POST['LOLOLOL'];
echo $da.$lol;
?>
I need to have the value of each button available after the form has been submitted.
Jcart
PostPosted: Mon Feb 27, 2006 1:45 pm Post subject:
a94060 wrote:
sory if i hijacked thread but wat do u mean by it is controlled by JS? i see it as all HTML with no Java tags.
Not to be blunt, but did you look at the source code?
The first 150 or so lines is all javascript.. and is called based on events such as
Code: Select all
onClick="go(this.id,'1-15A',this.value);"/>
i dont know where u see al this javascript because at the beginning of this thread thats the only code i see.
EDIT-i just checked the link:
http://ncaa.picktowin.net/bracket.html and saw what you guys meant....
Posted: Mon Feb 27, 2006 2:16 pm
by John Cartwright
Posted: Mon Feb 27, 2006 2:17 pm
by a94060
yep,as i jus edited,i saw that...haha

sorry for that.