Where to put submit button with multiple _GET or _POST??

Where to put submit button with multiple _GET or _POST??

am 23.05.2011 02:56:46 von Fahim M

--0016e6d9a2ce1bdabc04a3e6f266
Content-Type: text/plain; charset=ISO-8859-1

Hi
I am trying to create a user interface for my MySQL database. I got some
help earlier for my questions from some of the Php users on this site. I am
now stuck at a point from where I have no idea how to proceed.

I created a form with 5-6 options some of them uses mysql results based on
the previous options. I am using _GET and javascript to dynamically show the
options as one may be dependent upon the other. I put the submit button at
last. I want to go to a new page only after pressing the submit button.
Since I am using autoSubmit in javaScript it directs to the new page after I
select any of the option.

I know that this is possible but just dont know how to do it. I am
attaching the full code.

How to reset all the options by pressing the reset button once???.

Thanks a lot .

Php code:
[php]
$conn = mysql_connect('localhost', 'root', 'fahim');
$db = mysql_select_db('rugit',$conn);
if (!$db) die("Unable to connect to MySQL: " . mysql_error());
?>

$organism = $genomeVer = $queryType = $arrType = $arrTypeTarget = null;
//declare vars
if(isset($_GET["organism"]) && is_string($_GET["organism"]))
{
$organism = $_GET["organism"];
}
if(isset($_GET["genomeVer"]) && is_string($_GET["genomeVer"]))
{
$genomeVer = $_GET["genomeVer"];
}
if(isset($_GET["queryType"]) && is_string($_GET["queryType"]))
{
$queryType = $_GET["queryType"];
}
if(isset($_GET["arrType"]) && is_string($_GET["arrType"]))
{
$arrType = $_GET["arrType"];
}
if(isset($_GET["arrTypeTarget"]) && is_string($_GET["arrTypeTarget"]))
{
$arrTypeTarget = $_GET["arrTypeTarget"];
}
?>














//POPULATE DROP DOWN MENU FOR Genome version corresponding to a
given organism
$sql = "SELECT genomeVer FROM organismGenomeVer WHERE organism =
\"$organism\"";
//print("sql is $sql");
$result = mysql_query($sql,$conn);
//print("result is $result");
?>


";
//print "\n\nselected genome version is $genomeVer\n\n\n\n";

?>





($queryType == "idList") echo "checked"; ?> onclick="autoSubmit();" >
Identifier(s) as query

($queryType == "seqList") echo "checked"; ?> onclick="autoSubmit();"> Fasta
Seq(s) as query





$query = strtolower("show tables like \"$organism%\"");
//print("query is $query");
$result = mysql_query($query, $conn);
$nRows = mysql_num_rows($result);
//print"nRows is $nRows";
if ($queryType == "idList")
{
?>




";
mysql_free_result($result);
} //end if
?>



$query = strtolower("show tables like
\"$organism"."_"."$genomeVer%\"");
//print("query is $query");
$result = mysql_query($query, $conn);
$nRows = mysql_num_rows($result);
echo"

";
echo "Select target array:";
echo "

";
$val = implode(", ", $_GET["arrTypeTarget"]);
echo"

";
//print("arrTypeTarget is: $val");
//mysql_free_result($result);
echo"

";
?>




OR

Select File:









print ("\n$organism, $genomeVer, $queryType, $arrType");
?>


[/php]

--0016e6d9a2ce1bdabc04a3e6f266--

Re: Where to put submit button with multiple _GET or _POST??

am 23.05.2011 03:43:54 von Karl DeSaulniers

You can do it in javascript with..

document.form['yourformname'].reset();

or

onclick="this.form.reset();">

HTH,
Best,
Karl


On May 22, 2011, at 7:56 PM, Fahim Mohammad wrote:

> Hi
> I am trying to create a user interface for my MySQL database. I got
> some
> help earlier for my questions from some of the Php users on this
> site. I am
> now stuck at a point from where I have no idea how to proceed.
>
> I created a form with 5-6 options some of them uses mysql results
> based on
> the previous options. I am using _GET and javascript to dynamically
> show the
> options as one may be dependent upon the other. I put the submit
> button at
> last. I want to go to a new page only after pressing the submit
> button.
> Since I am using autoSubmit in javaScript it directs to the new
> page after I
> select any of the option.
>
> I know that this is possible but just dont know how to do it. I am
> attaching the full code.
>
> How to reset all the options by pressing the reset button once???.
>
> Thanks a lot .
>
> Php code:
> [php]
> > $conn = mysql_connect('localhost', 'root', 'fahim');
> $db = mysql_select_db('rugit',$conn);
> if (!$db) die("Unable to connect to MySQL: " . mysql_error());
> ?>
>
> > $organism = $genomeVer = $queryType = $arrType = $arrTypeTarget =
> null;
> //declare vars
> if(isset($_GET["organism"]) && is_string($_GET["organism"]))
> {
> $organism = $_GET["organism"];
> }
> if(isset($_GET["genomeVer"]) && is_string($_GET["genomeVer"]))
> {
> $genomeVer = $_GET["genomeVer"];
> }
> if(isset($_GET["queryType"]) && is_string($_GET["queryType"]))
> {
> $queryType = $_GET["queryType"];
> }
> if(isset($_GET["arrType"]) && is_string($_GET["arrType"]))
> {
> $arrType = $_GET["arrType"];
> }
> if(isset($_GET["arrTypeTarget"]) && is_string($_GET["arrTypeTarget"]))
> {
> $arrTypeTarget = $_GET["arrTypeTarget"];
> }
> ?>
>
>
>
>
>
>


>
>
>
>


>
>
>
> > //POPULATE DROP DOWN MENU FOR Genome version corresponding
> to a
> given organism
> $sql = "SELECT genomeVer FROM organismGenomeVer WHERE
> organism =
> \"$organism\"";
> //print("sql is $sql");
> $result = mysql_query($sql,$conn);
> //print("result is $result");
> ?>
>

> ";
> //print "\n\nselected genome version is $genomeVer\n\n\n\n";
>
> ?>
>
>
>


> > ($queryType == "idList") echo "checked"; ?> onclick="autoSubmit();" >
> Identifier(s) as query

> > ($queryType == "seqList") echo "checked"; ?> onclick="autoSubmit
> ();"> Fasta
> Seq(s) as query
>


>
>
> > $query = strtolower("show tables like \"$organism%\"");
> //print("query is $query");
> $result = mysql_query($query, $conn);
> $nRows = mysql_num_rows($result);
> //print"nRows is $nRows";
> if ($queryType == "idList")
> {
> ?>
>


>
";
> mysql_free_result($result);
> } //end if
> ?>
>
>
>
> > $query = strtolower("show tables like
> \"$organism"."_"."$genomeVer%\"");
> //print("query is $query");
> $result = mysql_query($query, $conn);
> $nRows = mysql_num_rows($result);
> echo"

";
> echo "Select target array:";
> echo "

";
> $val = implode(", ", $_GET["arrTypeTarget"]);
> echo"

";
> //print("arrTypeTarget is: $val");
> //mysql_free_result($result);
> echo"

";
> ?>
>
>
>
>
> OR
>
> Select File:
>

>

>
>
>
>
>
>
> > print ("\n$organism, $genomeVer, $queryType, $arrType");
> ?>
>
>
> [/php]

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Where to put submit button with multiple _GET or _POST??

am 23.05.2011 09:46:38 von Geoff Lane

On Monday, May 23, 2011, Fahim Mohammad wrote;

> How to reset all the options by pressing the reset button once???.
---

Unless I've read your question incorrectly, HTML provides the means
for this with a standard reset button:



or



HTH,

--
Geoff


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php