473,387 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

jquery pagination problem

pradeepjain
563 512MB
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3.         <script src="jquery.js" type="text/javascript"></script>
  4.         <script src="jquery.rating.js" type="text/javascript" language="javascript"></script>
  5.         <link href="jquery.rating.css" type="text/css" rel="stylesheet"/>
  6.         <link rel="stylesheet" type="text/css" href="style.css">
  7.  
  8. <script type="text/javascript">
  9. $(document).ready(function() {
  10.     $("#mobile_brand").change(function() {
  11.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  12.  $("#change").html(data);
  13. });
  14.     });
  15.     $("#property3").change(function() {
  16.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  17.  $("#change").html(data);
  18. });
  19.     });
  20.     $("#property4").change(function() {
  21.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  22.  $("#change").html(data);
  23. });
  24.     });
  25.     $("#property6").change(function() {
  26.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  27.  $("#change").html(data);
  28. });
  29.     });
  30. });
  31. </script>
  32.  
  33. </head>
  34. <body>
i have a small prob. the jquery.rating.js does work when the page is loaded but when the filtering takes place with the further jquery statements the 1st jquery.rating.js which replaces all the checkboxes with the star symbol does not work it displays the checkbox as it it!! i dont know whts the prob.
Nov 3 '09 #1

✓ answered by acoder

I've had a quick look at the code and I think I see where the problem might be. When you load the page, the code runs, so the page is updated, but when you make an update, you need to re-run the code to convert the radio buttons back to stars. Here's the code which you can try:
Expand|Select|Wrap|Line Numbers
  1. $('input[type=radio].star').rating();

25 5121
RamananKalirajan
608 512MB
Hi,
Just place the file inclusion in the end of the body in your html... Like call the function after the page is loaded... This will do.

Thanks and Regards
Ramanan Kalirajan
Nov 3 '09 #2
pradeepjain
563 512MB
what files !! i tried to keep the javascript files at end of body!!! but did not work!!!
Nov 3 '09 #3
RamananKalirajan
608 512MB
Hi, I dont have much knowledge on JQuery. I have worked in Prototype. Is there any Listener function or observer function for body load, if there just use that and place the script code inside that

Thanks and Regards
Ramanan Kalirajan
Nov 4 '09 #4
pradeepjain
563 512MB
as u can see in the code
Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3.     $("#mobile_brand").change(function() {
  4.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  5.  $("#change").html(data);
  6. });
  7.     });
  8.     $("#property3").change(function() {
  9.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  10.  $("#change").html(data);
  11. });
  12.     });
  13.     $("#property4").change(function() {
  14.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  15.  $("#change").html(data);
  16. });
  17.     });
  18.     $("#property6").change(function() {
  19.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  20.  $("#change").html(data);
  21. });
  22.     });
  23. });
  24. </script>
  25.  
is the code where ready body load is taken care of .
should i use the script code inside here or how?
Nov 4 '09 #5
RamananKalirajan
608 512MB
Can you please post the code for this "jquery.rating.js which replaces all the checkboxes with the star symbol". If possible attach the html files and Js Files.

Thanks and Regards
Ramanan Kalirajan
Nov 5 '09 #6
pradeepjain
563 512MB
you can find the jquery.rating.js

http://www.fyneworks.com/jquery/star.../#tab-Overview

i just name the checkbox class as star and it replaces it with star . if u still want ma code i will paste it.
Nov 5 '09 #7
RamananKalirajan
608 512MB
Post Your Code...

Thanks and Regards
Ramanan Kalirajan
Nov 5 '09 #8
pradeepjain
563 512MB
this is a page called product_display.php

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. include_once('db.php');
  4. include_once('valid-scripts/validateData.php');
  5. error_reporting (E_ALL & ~ E_NOTICE);
  6. ?>
  7. <html>
  8. <head>
  9.         <script src="jquery.js" type="text/javascript"></script>
  10.         <script src="jquery.rating.js" type="text/javascript" language="javascript"></script>
  11.         <link href="jquery.rating.css" type="text/css" rel="stylesheet"/>
  12.         <link rel="stylesheet" type="text/css" href="style.css">
  13.  
  14. <script type="text/javascript">
  15. $(document).ready(function() {
  16.     $("#mobile_brand").change(function() {
  17.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  18.  $("#change").html(data);
  19. });
  20.     });
  21.     $("#property3").change(function() {
  22.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  23.  $("#change").html(data);
  24. });
  25.     });
  26.     $("#property4").change(function() {
  27.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  28.  $("#change").html(data);
  29. });
  30.     });
  31.     $("#property6").change(function() {
  32.                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  33.  $("#change").html(data);
  34. });
  35.     });
  36. });
  37. </script>
  38.  
  39. </head>
  40. <body>
  41. <div id="layout">
  42. <br/>
  43. <?php include_once('menu.php'); ?>
  44. <h2>Mobiles</h2>
  45. <?php
  46. $sql1="select distinct(property1) from mobiles";
  47. $result1=mysql_query($sql1);
  48. $myresult1 = "";
  49. $myresult1 .= "<form name='' method='POST' action=''>";
  50. $myresult1 .= "<select name='mobile_brand' id='mobile_brand'>";
  51. $myresult1 .= "<option value=''>Mobile Brand</option";
  52. while($row1=mysql_fetch_array($result1)){
  53. $myresult1 .= "<option value='".$row1['property1']."'>".$row1['property1']."</option";
  54. }
  55. $myresult1 .= "</select>&nbsp;";
  56.  
  57.         $enumFields = getEnumFieldValues('mobiles', 'property4');
  58.         $myresult1 .=  "<select name='property4' id='property4'>";
  59.         $myresult1 .= "<option value=''>Price</option";
  60.          foreach($enumFields as $value)
  61.                {
  62.                   $myresult1 .= '<option value='.$value.'>'.str_replace("'","",$value).'</option>';
  63.                }
  64.         $myresult1 .= "</select>&nbsp;";
  65.  
  66.  
  67.         $enumFields = getEnumFieldValues('mobiles', 'property3');
  68.         $myresult1 .=  "<select name='property3'id='property3'>";
  69.         $myresult1 .= "<option value=''>Type</option";
  70.          foreach($enumFields as $value)
  71.                {
  72.                   $myresult1 .= '<option value='.$value.'>'.str_replace("'","",$value).'</option>';
  73.                }
  74. $myresult1 .= "</select>&nbsp;";
  75.  
  76.         $enumFields = getEnumFieldValues('mobiles', 'property6');
  77.         $myresult1 .= "<option value=''></option";
  78.         $myresult1 .=  "<select name='property6' id='property6' >";
  79.         $myresult1 .= "<option value=''>Os</option";
  80.          foreach($enumFields as $value)
  81.                {
  82.                   $myresult1 .= '<option value='.$value.'>'.str_replace("'","",$value).'</option>';
  83.   }
  84. $myresult1 .= "</select>";
  85.  
  86. $myresult1 .= "</form>";
  87. $myresult ='';
  88. $myresult .="<div id='change'>";
  89. $myresult .="<table width='100%'>";
  90. $sql2 = "select *  from mobile_master";
  91. $result2 = mysql_query($sql2);
  92. //$myresult .="<tr><td><b>&nbsp;</b></td>";
  93. //$myresult .="<td><b>Description</b></td>";
  94. //$myresult .="<td><b>Overall Rating</b></td>";
  95. //$j = 1;
  96. //while ($row2 = mysql_fetch_array($result2)){
  97. //if($j <= 1){
  98. //$myresult .="<td><b>".$row2['property1_name']."</b></td>";
  99. //$myresult .="<td><b>".$row2['property2_name']."</b></td>";
  100. //}
  101. //$j++;
  102. //}
  103. $myresult .="</tr>";
  104.  
  105. $myresult .="<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>";
  106. $sql="select * from mobiles";
  107. $result=mysql_query($sql);
  108. $i=0;
  109. while($row=mysql_fetch_array($result)){
  110. $sqlr="select overall_rating from mobiles where property1='". $row['property1']."' and property2='". $row['property2']."'";
  111. $resultr=mysql_query($sqlr);
  112. $rating = mysql_fetch_array($resultr);
  113. $myresult .="<tr><td><center>";
  114. if($row['pic'] != ""){
  115. $myresult .= "<a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='picdisplay.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'</img></a><br/>".$row['property1']."&nbsp;". $row['property2'] ;
  116. }
  117. else
  118. {
  119. $myresult .= "<a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='images/no-image.gif' width='50' height='70'</img></a><br/>".$row['property1']."&nbsp;". $row['property2'];
  120. }
  121. $myresult .="</center></td>";
  122.  
  123. /*if($row['description'] != ""){
  124. $myresult .= "<td>" . $row['description']. "</td>";
  125. }
  126. else
  127. {
  128. $myresult .= "<td>&nbsp;</td>";
  129. }*/
  130. //if($rating['overall_rating'] != ""){
  131. $i++;
  132. $myresult .= "<td>";
  133. for($k = 1; $k <= 10; $k++)
  134. {
  135. if($rating['overall_rating'] == $k)
  136. {
  137.         $chk ="checked";
  138. }
  139. else
  140. {
  141.         $chk = "";
  142. }
  143. $myresult .= "<input class='star' type='radio' name='rating".$i."' id='rating".$i."' value='". $k ."' $chk title='". $k." out of 10 ' disabled/>&nbsp;&nbsp;";
  144. }
  145. $myresult .= "</td>";
  146. /*$myresult .= "<td>" . $rating['overall_rating']. "</td>";
  147. }
  148. else
  149. {
  150. $myresult .= "<td>&nbsp;</td>";
  151. }*/
  152. //$myresult .= "<td>" . $row['property1']. "</td>";
  153. //$myresult .= "<td>" . $row['property2']. "</td>";
  154. $myresult .="</tr>";
  155. }
  156. $myresult .="</table>";
  157. $myresult .="</div>";
  158. echo $myresult1;
  159. echo "<br/>";
  160. echo "<br/>";
  161. echo $myresult;
  162. ?>
  163. <br/>
  164. </body>
  165. </html>

and this is mobile_change.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once('db.php');
  3. include_once('valid-scripts/validateData.php');
  4. $_POST=snipExtras($_POST);
  5. $mobile_brand=$_POST['brand'];
  6.  
  7. $price=$_POST['price'];
  8.  
  9. $type=$_POST['type'];
  10.  
  11. $os=$_POST['os'];
  12.  
  13. $build_query = "";
  14.         $add = "";
  15.         $append = "";
  16. if($mobile_brand != "")
  17. {
  18.         $append = "yes";
  19.         $build_query .= " property1 = '" .$mobile_brand ."'";
  20. }
  21. if($price != "")
  22. {
  23.         if($append =="yes")
  24.         {
  25.         $add = "and";
  26.         }
  27.         $append = "yes";
  28.         $build_query .= " $add property4 = '" .$price ."'";
  29. }
  30.  
  31. if($type != "")
  32. {
  33.         if($append =="yes")
  34.         {
  35.         $add = "and";
  36.         }
  37.         $append = "yes";
  38.         $build_query .= " $add property3 = '" .$type ."'";
  39. }
  40.  
  41. if($os != "")
  42. {
  43.         if($append =="yes")
  44.   {
  45.         $add = "and";
  46.         }
  47.         $build_query .= " $add property6 = '" .$os ."'";
  48. }
  49. $myresult ='';
  50. $myresult .="<div id='change'>";
  51. $myresult .="<table  width='100%'>";
  52. $sql2 = "select *  from mobile_master";
  53. $result2 = mysql_query($sql2);
  54. $myresult .="<tr><td><b>&nbsp;</b></td>";
  55. //$myresult .="<td><b>Description</b></td>";
  56. //$myresult .="<td><b>Overall Rating</b></td>";
  57. //$j = 1;
  58. //while ($row2 = mysql_fetch_array($result2)){
  59. //if($j <= 1){
  60. //$myresult .="<td><b>".$row2['property1_name']."</b></td>";
  61. //$myresult .="<td><b>".$row2['property2_name']."</b></td>";
  62. //}
  63. //$j++;
  64. //}
  65. $myresult .="</tr>";
  66. $myresult .="<tr><td>&nbsp;</td><td>&nbsp;</td></tr>";
  67. if($build_query != ""){
  68. $sql="select * from mobiles where $build_query ";
  69. $result=mysql_query($sql);
  70. $count = mysql_num_rows($result);
  71.  
  72. if($count > 0){
  73. $sql="select * from mobiles where $build_query ";
  74. $result=mysql_query($sql);
  75. $i=0;
  76. while($row=mysql_fetch_array($result)){
  77. $sqlr="select overall_rating from mobiles where property1='". $row['property1']."' and property2='". $row['property2']."'";
  78. $resultr=mysql_query($sqlr);
  79. $rating = mysql_fetch_array($resultr);
  80.  
  81. $myresult .="<tr>";
  82. if($row['pic'] != ""){
  83. $myresult .= "<td><center><a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='picdisplay.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'</img></a></center><center>". $row['property1']."&nbsp;".$row['property2'] ."</center></td>";
  84. }
  85. else
  86. {
  87. $myresult .= "<td><center><a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='images/no-image.gif' width='50' height='70'</img></a></center><center>". $row['property1']."&nbsp;".$row['property2'] ."</center></td>";
  88. }
  89. /*if($row['description'] != ""){
  90. $myresult .= "<td>" . $row['description']. "</td>";
  91. }
  92. else
  93. {
  94. $myresult .= "<td>&nbsp;</td>";
  95. }*/
  96. /*if($rating['overall_rating'] != ""){
  97. $myresult .= "<td>" . $rating['overall_rating']. "</td>";
  98. }
  99. else
  100. {
  101. $myresult .= "<td>&nbsp;</td>";
  102. }
  103. */
  104. $i++;
  105. $myresult .= "<td>";
  106. for($k = 1; $k <= 10; $k++)
  107. {
  108. if($rating['overall_rating'] == $k)
  109. {
  110.         $chk ="checked";
  111. }
  112. else
  113. {
  114.         $chk = "";
  115. }
  116. $myresult .= "<input class='star' type='radio' name='rating".$i."' id='rating".$i."' value='". $k ."' $chk title='". $k." out of 10 ' disabled/>&nbsp;&nbsp;";
  117. }
  118. $myresult .= "</td>";
  119.  
  120. //$myresult .= "<td>" . $row['property1']. "</td>";
  121. //$myresult .= "<td>" . $row['property2']. "</td>";
  122. $myresult .="</tr>";
  123. }
  124. }
  125. else if($count == 0 && $build_query != ""){
  126. $myresult .= "<tr> <td colspan='5'><p class='message'>Sorry No Product Yet available for Display </p></td></tr>";
  127. }
  128.  
  129. }
  130. else if($build_query == ""){
  131. $sql="select * from mobiles";
  132. $result=mysql_query($sql);
  133. $i=0;
  134. while($row=mysql_fetch_array($result)){
  135. $sqlr="select overall_rating from mobiles where property1='". $row['property1']."' and property2='". $row['property2']."'";
  136. $resultr=mysql_query($sqlr);
  137. $rating = mysql_fetch_array($resultr);
  138.  
  139.  
  140. $myresult .="<tr>";
  141. if($row['pic'] != ""){
  142. $myresult .= "<td><center><a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='picdisplay.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'</img></a></center><center>".$row['property1']."&nbsp;".$row['property2']."</center></td>";
  143. }
  144. else
  145. {
  146. $myresult .= "<td><center><a href='mobile_rating.php?brand=". $row['property1'] . "&model=".$row['property2'] . "'><img src='images/no-image.gif' width='50' height='70'</img></a></center><center>". $row['property1']."&nbsp;".$row['property2']."</center></td>";
  147. }
  148. /*if($row['description'] != ""){
  149. $myresult .= "<td>" . $row['description']. "</td>";
  150. }
  151. else
  152. {
  153. $myresult .= "<td>&nbsp;</td>";
  154. }*/
  155. /*if($rating['overall_rating'] != ""){
  156. $myresult .= "<td>" . $rating['overall_rating']. "</td>";
  157. }
  158. else
  159. {
  160. $myresult .= "<td>&nbsp;</td>";
  161.      }
  162. */
  163. $i++;
  164. $myresult .= "<td>";
  165. for($k = 1; $k <= 10; $k++)
  166. {
  167. if($rating['overall_rating'] == $k)
  168. {
  169.         $chk ="checked";
  170. }
  171. else
  172. {
  173.         $chk = "";
  174. }
  175. $myresult .= "<input class='star' type='radio' name='rating".$i."' id='rating".$i."' value='". $k ."' $chk title='". $k." out of 10 ' disabled/>&nbsp;&nbsp;";
  176. }
  177. $myresult .= "</td>";
  178.  
  179.  
  180. //$myresult .= "<td>" . $row['property1']. "</td>";
  181. //$myresult .= "<td>" . $row['property2']. "</td>";
  182. $myresult .="</tr>";
  183. }
  184.  
  185. }
  186. $myresult .="</table>";
  187. $myresult .="</div>";
  188. echo $myresult;
  189.  
  190. ?>
Nov 5 '09 #9
pradeepjain
563 512MB
i am using jquery something like this
Expand|Select|Wrap|Line Numbers
  1. # <script type="text/javascript">
  2. # $(document).ready(function() {
  3. #     $("#mobile_brand").change(function() {
  4. #                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  5. #  $("#change").html(data);
  6. # });
  7. #     });
  8. #     $("#property3").change(function() {
  9. #                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  10. #  $("#change").html(data);
  11. # });
  12. #     });
  13. #     $("#property4").change(function() {
  14. #                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  15. #  $("#change").html(data);
  16. # });
  17. #     });
  18. #     $("#property6").change(function() {
  19. #                 $.post("mobile_change.php",{ brand:$("#mobile_brand").val(),price:$("#property4").val(),type:$("#property3").val(),os:$("#property6").val() } ,function(data){
  20. #  $("#change").html(data);
  21. # });
  22. #     });
  23. # });
  24. # </script>
  25. #  
to filter using the drop downs!!!! but when paginations of these filtered values the filtration is going off and it will show the all the values!! how to achieve pagination of filtered values?? or which is the best way to use jquery for this purpose!
Nov 9 '09 #10
acoder
16,027 Expert Mod 8TB
Haven't looked at your code in detail, but perhaps the problem lies in the fact that you're setting the element with ID "change" to include another element with ID "change".

PS. threads merged. Please do not double post.
Nov 9 '09 #11
pradeepjain
563 512MB
the 1st problem was different from the second so posted it again with different name sorry .

so how exactly is the way to solve the problem .

my need is like .

there are 4 dropdowns depending on which the respective entries from DB must be selected . and pagination is also required ..
will jquery be helpful for this ?
Nov 10 '09 #12
pradeepjain
563 512MB
i cld solve the pagination problem by using the form $_GET and stuff !! but the original problem which i posted 1st still remains!!can any one plz look at code and help me ??
Nov 10 '09 #13
acoder
16,027 Expert Mod 8TB
You have the following line:
Expand|Select|Wrap|Line Numbers
  1.  $("#change").html(data);
This sets the element "change" to the response of the Ajax request to mobile-change.php.

In that PHP file, the response includes this line:
Expand|Select|Wrap|Line Numbers
  1. $myresult .="<div id='change'>";
which means multiple duplicate IDs. Either remove this line or make the ID unique.
Nov 10 '09 #14
pradeepjain
563 512MB
oh okie!! i thought it will replace the element with ID change with the data in mobile_change.php ..... so added it ....

hey i checked the source code ...the ID "change" is there only 1 time after the jquery has also executed !
Nov 10 '09 #15
pradeepjain
563 512MB
the exact problem is that the starts which are replacing the radio buttons in not appearing once the jquery is executed !! but when the 1st time page loads the starts are appearing !!! i just repeated my problem to be clear!
Nov 10 '09 #16
acoder
16,027 Expert Mod 8TB
I've had a quick look at the code and I think I see where the problem might be. When you load the page, the code runs, so the page is updated, but when you make an update, you need to re-run the code to convert the radio buttons back to stars. Here's the code which you can try:
Expand|Select|Wrap|Line Numbers
  1. $('input[type=radio].star').rating();
Nov 11 '09 #17
pradeepjain
563 512MB
okie that piece of code worked ... i need a small help ...i am trying to display the value when he/she clicks on the stars . but the onclick is not working .

the webisite had given some code to alert the star rate

Expand|Select|Wrap|Line Numbers
  1. $('.auto-submit-star').rating({
  2.   callback: function(value, link){
  3.     alert(value);
  4.   }
  5. });

but its not working .. help on this !
Nov 11 '09 #18
acoder
16,027 Expert Mod 8TB
That's probably because '.auto-submit-star' should be '.star'
Nov 11 '09 #19
pradeepjain
563 512MB
nope i replaced it with star only !!! the stars are appearing but when i click on any star the the alert is not coming

i just modified the code like

Expand|Select|Wrap|Line Numbers
  1. <script>
  2. $(function(){
  3. $('input[type=radio].star').rating({
  4.   callback: function(value, link){
  5.    alert("yes");
  6.   }
  7.  });
  8. });</script>
  9.  
Nov 11 '09 #20
pradeepjain
563 512MB
the entire (small piece concerning it )
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. $(function(){
  3. $('input[type=radio].star').rating({
  4.   callback: function(value, link){
  5.    alert("yes");
  6.   }
  7.  });
  8. });</script>
  9.  
  10. <?php
  11. for ($i = 1 ; $i < $count; $i++){
  12. if($row2['rating'.$i.'_name']){
  13. $myresult .= "<tr><td>";
  14. $indfeature = 0;
  15. $indfeature = getindividualrating(rating.$i,$brand,$model);
  16. $myresult .= $row2['rating'.$i.'_name']." (".round($indfeature) .")<br/><br/>";
  17. $myresult .= "</td>";
  18. $myresult .= "<td>";
  19. $myresult .= "<div class='Clear'>";
  20. if($user != "")
  21.         {
  22.                 $tocheck = $ratingchk[$i];
  23.         }
  24.         else
  25.         {
  26.                 $tocheck = round($indfeature);
  27.         }
  28. for($k = 1; $k <= 10; $k++){
  29. if($tocheck == $k){
  30. $chk = "checked";
  31. }
  32. else
  33. {
  34. $chk = "";
  35. }
  36. $myresult .= "<input class='star' type='radio' name='rating".$i."' id='rating".$i."' value='". $k ."' $chk $disabled title='". $k." out of 10 ' onclick=\" return sayvalue(this);\"/>&nbsp;&nbsp;";
  37. }
  38. $myresult .= "<span id='current-rating".$i."'> </span>";
  39. $myresult .= "</div>";
  40. $myresult .= "</td>";
  41. $myresult .= "</tr>";
  42. }
  43. }
  44.  
  45.  
Nov 11 '09 #21
pradeepjain
563 512MB
is there something wrong in code that i need to change ?
Nov 17 '09 #22
acoder
16,027 Expert Mod 8TB
Can you post a link to a test page? If not, post the HTML code.
Nov 18 '09 #23
pradeepjain
563 512MB
Expand|Select|Wrap|Line Numbers
  1.    1. $('input[type=radio].star').rating();
hey this command worked for me.. i have a similar problem . there is a page like www.xyz.com/mobile1.php?alias='Nokia3110c' where the jquery stars are displayed .

i use clean urls where in page url looks like
www.xyz.com/Mobiles/Nokia3110c

all things are loaded properly but the jquery rating stars are not displayed . but in www.xyz.com/mobile1.php?alias='Nokia3110c' its loaded . what might be the problem?
Jan 19 '10 #24
RedSon
5,000 Expert 4TB
Suryakant,

You can link to your company's website but please do not make the link your name. Just be up front and put the company link below your name.

-RedSon
Jan 22 '10 #25
acoder
16,027 Expert Mod 8TB
@pradeepjain: I'm not sure why that would be. I'd need to look at the page. Do you have a test page link?
Jan 30 '10 #26

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Chris H | last post by:
I am having a problem with pagination, basically the problem is happening in the "PREV / NUMBERS / NEXT" links, it appears as if the reason is becasue the increment and decrement operators aren't...
11
by: ste | last post by:
Hi there, Further to my recent posts where I've received excellent help from Rik and Jerry, I've ended up with an image gallery on my website that displays images in a table, 3 images per row. ...
26
by: RobG | last post by:
Do some of the regulars here need to re-think their (sometimes strident) opposition to libraries? Both Microsoft and Nokia have announced support for jQuery. It seems to have gained quite a bit...
16
by: gnawz | last post by:
I have a pagination function I am using in a file called functions.php as below<? //Pagination functions function getPagingQuery($sql, $itemPerPage = 10) { if (isset($_GET) && (int)$_GET > 0) ...
2
by: souporpower | last post by:
Hi All I am trying to print some HTML using JQUERY. I am posting the code. I don't see the alert. It seems as though the function is not registered when the document is loaded. Can someone...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
4
by: ArizonaJohn | last post by:
Hello, The code below works great. The user enters a name into an HTML form, the code looks up a table with that name, and then that table is displayed. I am trying to use pagination with it,...
2
by: kkshansid | last post by:
this is my search page on which i am getting two parameters from previous page but the problem is that as soon as i click any other next pages my sql query fails as it doesnt get these two parameters...
1
by: spyderfusion02 | last post by:
Hey, I'm trying to get my pagination numbers to update when the user uses the filter options at the side. Here is what I'm talking about: When you click the color - Yellow - you should only get 1...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.