Saturday, 15 February 2014

php - submit button being created inside of submit button -



php - submit button being created inside of submit button -

i'm having problem submit button in form, when clicked first reloads current page, creates submit button within of original 1 before posting post page.

you can see behavior illustration here:

http://tampary.com/pick_game.php?c_id=15&p_id=0&f_id=1&l_id=1

you can click in browser after clicking "start game" , see nested controls. using chrome , firefox, same results. ideas causing behavior? ideally, want php page redirected after form submit load cleanly. help appreciated

the finish code follows:

<?php require_once(dirname(__file__).'/grl-lib/db.php'); require_once(dirname(__file__).'/grl-lib/ui.php'); require_once(dirname(__file__).'/grl-lib/family.php'); require_once(dirname(__file__).'/grl-lib/location.php'); require_once(dirname(__file__).'/grl-lib/contact.php'); $ui = new x_ui; $ui->set_ui(1); if (!empty($_post)){ $p_id = $_post['p_id']; $f_id = $_post['f_id']; $l_id = $_post['l_id']; $c_id = $_post['c_id']; }else{ $p_id = $_get['p_id']; $f_id = $_get['f_id']; $l_id = $_get['l_id']; $c_id = $_get['c_id']; } ?> <!doctype html> <html lang="<?php echo $ui->getlocale($ui->language_id,1); ?>"> <head> <?php include_once('grl-lib/gen_include.php'); ?> <meta name="robots" content="noindex"> <!-- no indexing page --> <link href="css/main.css" rel="stylesheet" type="text/css"> <link href="css/devices.css" rel="stylesheet" type="text/css"> <title>tampary<?php ' '._('game'); ?></title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <meta name=viewport content="width=device-width, initial-scale=1"> </head> <body class="color_bg"> <?php include('standard/header.txt'); ?> <!-- content --> <div class="entire_content_length aling_text_c"> <div class="max_width_responsive align_container_c spc_a_5"> <div class="align_container_c spc_a_5 container_c"> <form id="pick_game" action="game.php" method="post"> <?php $html = '<input type="hidden" name="p_id" id="p_id" value="'.$p_id.'"><input type="hidden" name="f_id" id="f_id" value="'.$f_id.'"><input type="hidden" name="l_id" id="l_id" value="'.$l_id.'"><input type="hidden" name="c_id" id="c_id" value="'.$c_id.'">'; //$html = $html.'<input type="submit" value="'._('start game').'">'; echo $html; ?> <input type="submit" value="start game"> </form> </div> </div> </div> <?php include('standard/footer.txt'); ?> </body> </html>

i see using ajax script, fine. culprit cause can see responding entire page in firebug.

i bet front end page ajax , append somewhere (can't find fast).

whatever case, i'm not convinced ever doing (loading entire page through ajax) practice.

looking @ ajax requests solve inception button problem

php html forms

No comments:

Post a Comment