Open Source & Stuff  
  |     Main Site     |      Forum     |     Contact     |
Ajax Linked Select boxes :  forum.Salix.gr forum.Salix.gr
Comments, questions, usage, bugs. 
Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
messageAdd Sumbit Button
Posted by: ayhaner (IP Logged)
Date: June 30, 2007 07:05AM

Hello All

My English bad I sory.

I setup Ajax Linked Select Boxes my site:

[www.dodisim.com] (please click to see)

I want last select boxes add sumbit button who make?

please write for me sample php code

thank you very much.

messageRe: Add Sumbit Button
Posted by: panos (IP Logged)
Date: July 02, 2007 03:44AM

Hi Ayhener,

Now, if you want when user makes selection in last select box use the javascript in the example [www.salix.gr].

But If you just want a submit button then add a form tag

<form method="post" action="your_script.php">
<?php
$sc_ajax_select_boxes->show_select_box('sel1');
$sc_ajax_select_boxes->show_select_box('sel2');
$sc_ajax_select_boxes->show_select_box('sel3');
$sc_ajax_select_boxes->show_select_box('sel4');
?>
<input type="submit">
</form>

and you will get values in $_POST.

hope it helped.

Regards
Panos

messageRe: Add Sumbit Button
Posted by: ayhaner (IP Logged)
Date: July 02, 2007 04:20AM

Thank you very much.. Mr. Panos

messageRe: Add Sumbit Button (problem)
Posted by: ayhaner (IP Logged)
Date: July 04, 2007 03:11AM

Hello again Mr Panos I added code my index.php

<html>
<head>
<title>Lastik Seçici</title>
<META NAME="author" CONTENT="Panos Kyriakakis">
<meta name="description" lang="en" content="Demo page. Linked selected boxes that load items from database using AJAX">
<meta name="keywords" lang="en" content="Lastik Seçici">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
<META name="verify-v1" content="2CKKXxDtxsHjE7TjmXjWJSzMj5xqXOvTrnZ27goGJSE=" />
<META name="robots" content="follow,index" />
</head>
<body>
<script src="prototype.js" type="text/javascript"></script>
<h2><a href="example.php">Lastik Seçici Program</a></h2>
<?php

include("top_script.php");
include("sc_classes.php");

$sc_ajax_select_boxes = new sc_ajax_select_boxes();
$sc_ajax_select_boxes->add_select_box('sc_page_types','page_type','type_descr','page_type','','sel1','sel_id_1','');
$sc_ajax_select_boxes->add_select_box('sc_page_types_sub','sub_type','type_descr','sub_type','st21','sel2','sel_id_2','');
$sc_ajax_select_boxes->add_select_box('sc_page_types_sub_sub','sub_type','type_descr','sub_type','st22','sel3','sel_id_3','');
$sc_ajax_select_boxes->add_select_box('sc_page_types_sub_sub','sub_type','type_descr','sub_type','st22','sel4','sel_id_4','');
$sc_ajax_select_boxes->link_select_boxes('sel1','sel2', 'page_type','t2');
$sc_ajax_select_boxes->link_select_boxes('sel2','sel3', 'page_type','st22');
$sc_ajax_select_boxes->link_select_boxes('sel3','sel4', 'page_type','st22');
$sc_ajax_select_boxes->place_jscripts();
<form method="post" action="your_script.php">
<?php
$sc_ajax_select_boxes->show_select_box('sel1');
$sc_ajax_select_boxes->show_select_box('sel2');
$sc_ajax_select_boxes->show_select_box('sel3');
$sc_ajax_select_boxes->show_select_box('sel4');
?>
<input type="submit"value="OKEY" name="B1">
</form>
?>
</body>
</html>



web site: error

messageRe: Add Sumbit Button
Posted by: panos (IP Logged)
Date: July 04, 2007 05:30AM

i took a look at [www.dodisim.com] the link you gave me the other day
and you post your form to sayfa.php
<form action="sayfa.php" method="POST">

which is not there, atleast in the same folder with example.php

please check the location of sayfa.php

messageRe: Add Sumbit Button
Posted by: panos (IP Logged)
Date: July 04, 2007 05:38AM

create a file named sayfa.php in the same folder with the code

<?php

print_R($_POST);

?>

and you will see selected values.

messageRe: Add Sumbit Button
Posted by: ayhaner (IP Logged)
Date: July 04, 2007 05:54AM

Ok Thank you.

messageRe: Add Sumbit Button
Posted by: ayhaner (IP Logged)
Date: July 04, 2007 08:18AM

VERRY GOD. Okey NO PROBLEMS.. THANK YOU

sayfa.php

<?php
if(!empty($_POST['sel4'])){
echo "
<script>
location.href = \"http://www.trabzonajans.com/kelesoglu/show.php?id={$_POST['sel4']}\";
</script>
";
}
?>



Edited 1 time(s). Last edit at 07/04/2007 09:12AM by ayhaner.

messageRe: Add Sumbit Button
Posted by: panos (IP Logged)
Date: July 04, 2007 03:59PM

Always here to help winking smiley



Sorry, only registered users may post in this forum.

All Rights Reserved 2006 Salix.gr  |  Design by Ades Design |  Hosting by e-emporio |  forum.Salix.gr powered by Phorum