Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jQuery] Select i przekazanie wartości do pliku php
einter-project
post
Post #1





Grupa: Zarejestrowani
Postów: 39
Pomógł: 0
Dołączył: 9.09.2011

Ostrzeżenie: (10%)
X----


Witam

Napisałem taki kod:

  1.  
  2. .....
  3. <select class="inputSelectGray" name="formStyle">
  4. <optgroup label="Pojedyńczy wykres">
  5. <option value="single_series_charts/FCF_Column2D.swf">Column 2D</option>
  6. <option value="single_series_charts/FCF_Column3D.swf">Column 3D</option>
  7. <option value="single_series_charts/FCF_Line.swf">Line 2D</option>
  8. <option value="single_series_charts/FCF_Area2D.swf">Area 2D</option>
  9. <option value="single_series_charts/FCF_Bar2D.swf">Bar 2D</option>
  10. <option value="single_series_charts/FCF_Pie2D.swf">Pie 2D</option>
  11. <option value="single_series_charts/FCF_Pie3D.swf">Pie 3D</option>
  12. <option value="single_series_charts/FCF_Doughnut2D.swf">Doughnut 2D</option>
  13. ......
  14. <script type="text/javascript">
  15. $(document).ready(function(){
  16. var formStyle = "";
  17.  
  18. $("[name=formStyle]").change(function(){
  19. $("select option:selected").each(function () {
  20. formStyle = $(this).val();
  21. });
  22. });
  23.  
  24. $.ajax({
  25. url: "modulesALL/ranking/preview.php?style="+formStyle,
  26. success: function(results) { $('#preview').html(results); }
  27. });
  28. });


PLIK PHP
  1. $_GET['style'] = isset($_GET['style']) ? $_GET['style'] : '';
  2.  
  3. include("../../../class/fusionCharts/includes/fusionCharts.php");
  4.  
  5. if($_GET['style'] == false){
  6. $_GET['style'] = 'single_series_charts/FCF_Column3D.swf';
  7. }
  8.  
  9. print renderChartHTML($_SESSION['DB_DOMAIN_ALL']."class/fusionCharts/flash/".$_GET['style'], $_SESSION['DB_DOMAIN_ALL']."class/fusionCharts/flash/single_series_charts/schemat.xml", "", "myFirst", 450, 450)
  10. ?>


I teraz chciałbym metodą get przekazać wybraną wartość do pliku php bez odświerzenia strony.

Może ktoś mnie naprowadzić co robię nie tak?

Pozdrawiam

Ten post edytował einter-project 16.04.2012, 18:24:28
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 03:28