Re: PHP button

From: Date: Mon, 26 Apr 2004 12:21:20 +0000
Subject: Re: PHP button
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-184619@lists.php.net to get a copy of this message
"Brent Clark" <bclark@equation.co.za> wrote in message news:000901c42b81$eac7ba70$68b2a8c0@brent... > Hi all > > I have been for some time trying to get this right > > I need to diable a button, which I can do with javascript, all works fine > until the submit \ posting part . > > this is my part of my code below: > > This is my form section: > --------------------------- > <form action="scanbatch.php" method="POST" name="frm" > > > This is my php code, if the conditions are met: > ----------------------------------------------- > echo "<input type=\"button\" name=\"read\" value=\"Next\" > onclick=\"dob();\">"; > > This is my javascript: > ----------------------- > <script language="javascript"> > <!-- > function dob(){ > document.frm.read.disabled=true; > document.frm.submit(); > } > file://-> > </script> > > The button does disable the button like it should > the problem is that, apart from the disabling of the button, the does not > update my database. > In fact it does nothing > BUT > if I change the "type" from "button" to "submit" in the > <input> tag. > Then it works > I cant find away for this to work. (Co exist) > Could someone please help > I feel the problem defiantly lies with PHP > > Kind Regards and thanks in advance > Brent Clark Hi Brent, try checking $_POST['read_x'] instead of $_POST['read'] in your processing script because buttons will get an x and y coordinate to determine at what position the user pressed the button. This is different to button type "submit". For similar problems like this do a print_r($_REQUEST) at the top of the processing script to see which variables are available. Regards, Torsten

« previous php.general (#184619) next »