Search the Community
Showing results for tags 'jquery'.
-
im designing a online coupon site,,, there are several products displaying in my home page, when you click on each product, there is a coupon image displaying, but All that i want is, i want the users select the products they like. and there is a seperate print button. so i wanted the users to print the coupon of multiple selected products at once when click on the print button... for exaample, simillar as this website: visit http://www.coupons.com/
-
- php
- javascript
-
(and 2 more)
Tagged with:
-
I'm not sure if this is the right place for this, but since php is sort of the hub I figure this might work. I'm struggling with finding the right way to snag a variable from a javascript prompt and pass that through to the server for a mysql query. I'm relatively new to all of this, so any help (even the obvious stuff) would be greatly appreciated. Here's my situation... I'm using a scheduling plugin on Wordpress that allows users to schedule an appointment with a service provider. Unfortunately, these appointments are for a set duration (e.g. 30 minutes). I'd like to allow the user to select their start time and then set their own duration. The plugin uses jQuery to display a calendar in table format and the user can click on a date/time that works for them. Then a new <div> appears on the page to confirm the appointment. I would basically like to insert a javascript prompt when the user clicks on their starting time that asks for the duration in hours. I need to pass this value back to the server (using jQuery or Ajax I'm guessing?) so I can send a query to the database and check if this time conflicts with other appointments, then continue with the confirmation <div>. I've spent probably 2 or 3 hours searching Google and I'm simply not finding a way to do this. Seems like it should be straightforward, but the answer is eluding me.
-
Hey guys why do i keep getting a problem with a redirect loop... i dont know why and i just get: http://www.powerwashers.co.uk/temp/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/main/index.php Its mainly when i click that google link although its just been happening on most things i do... also it doesnt display in firefox :/... Can anyone help me please?. http://www.powerwashers.co.uk/temp/main/expo.php <!DOCTYPE html> <head> <title>Brendon Powerwashers - News & Exhibitions</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <meta name="language" content="en"/> <meta name="robots" content="index, follow"/> <meta name="description" content=""/> <meta name="keywords" content=""/> <link rel="stylesheet" href="stylesheet/style1.css" type="text/css"/> <link rel="stylesheet" href="stylesheet/style6.css" type="text/css"/> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/navigation_hide_show.js"></script> <script type="text/javascript" src="js/hover_script.js"></script> <script type="text/javascript" src="js/fader.js"></script> <script type="text/javascript" src="js/bg_fade.js"></script> <script type="text/javascript" src="js/jquery_script01.js"></script> <script type="text/javascript" src="js/app_fader.js"></script> <script type="text/javascript" src="js/navigation_dropdown.js"></script> </head> <body style='display:none;' class='body'> <div id="header"> <?php include('content/navigation2.php'); ?> </div> <div id="page_wrapper"> <div id="page"> <?php include('content/acc_navigation.php'); ?> <div id="fp_top2" style='margin-bottom:-3px;'> <div id="fp_nav"> <ul> <a href="#" id="fade1_link"><li>Exhibitions</li></a> <a href="#" id="fade2_link"><li>Latest News</li></a> <a><li> </li></a><!--id="fade3_link"--> <a><li> </li></a><!--id="fade4_link"--> <a><li> </li></a><!--id="fade5_link"--> <a><li> </li></a><!--id="fade6_link"--> <a><li> </li></a><!--id="fade7_link"--> </ul> </div> <div id="fader_img2"> <img id='fade1' class="fader_images" src="images/exhibition_banner.jpg" alt="Fader"/> <img id='fade2' class="fader_images" src="images/about_fader.jpg" alt="Fader"/> <img id='fade3' class="fader_images" src="images/fader/1_3.jpg" alt="Fader"/> <img id='fade4' class="fader_images" src="images/fader/1_4.jpg" alt="Fader"/> <img id='fade5' class="fader_images" src="images/fader/1_5.jpg" alt="Fader"/> <img id='fade6' class="fader_images" src="images/fader/1_6.jpg" alt="Fader"/> <img id='fade7' class="fader_images" src="images/fader/1_7.jpg" alt="Fader"/> </div> </div> <div> <div id="sheet2_1" class="fader_sheets"> <div class="white_bg"> <h1 style=" text-align:center; font-size:26px">Exhibitions</h1><br/> <?php $expire = date('Ymd'); $select_query8 = mysql_query("SELECT * FROM expos ORDER BY expire"); while($select_query_row8 = mysql_fetch_array($select_query8)){ if($select_query_row8['expire'] > $expire) { echo ' <div style="width:200px; height:300px; border:1px solid #000; float:left; margin-top:10px; margin-left:5px; margin-right:5px; margin-bottom:10px; padding:5px;"> <div style="width:300px; margin:0px auto;"><img src="images/logos/'.$select_query_row8['image_url'].'" alt="Show Logo"/></div> <h1 style="text-align:center;">'.$select_query_row8['header'].'</h1><h1 style="text-align:center; font-size:14px; margin-top:4px">('.$select_query_row8['start_day'].'/'. $select_query_row8['start_month'].'/'.$select_query_row8['start_year']. ' - '.$select_query_row8['end_day'].'/'. $select_query_row8['end_month'].'/'.$select_query_row8['end_year'].')</h1><br/>'; echo '<p style="text-align:center">'.$select_query_row8['content'].'<br/><a href="www.google.com" class="expo1" >www.google.com</a></p> </div> '; } } ?> </div> </div> <div id="sheet2_2" class="fader_sheets"> <div class="white_bg"> <h1 style=" text-align:center; font-size:26px">Latest News</h1> <p>Coming Soon...</p> </div> </div> <div id="sheet2_3" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_4" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_5" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_6" class="fader_sheets"> <div class="white_bg"> </div> </div> <div id="sheet2_7" class="fader_sheets"> <div class="white_bg"> </div> </div> </div> </div> </div> <div id="background"></div> </body> </html>
-
I have been stuck on this for 3 days... I would love the experts to shoot me some words of advice, appreciate it. I have a form I create from a while loop in php. I can submit it if I name the form and place that in the AJAX but it just uploads the last record in the table not the one I actually click. I know I need a unique ID from the form, which I have but I can get it in the AJAX ;( I have used $(this).attr("id") , $(this).form("id") etc and nothing gets it in.. Any advice would be great MY PHP Loop while($row = mysql_fetch_array($pendingresult)) { $id = "myForm".$row['reg_id']; echo '<table width="100%" border="0" cellspacing="0" cellpadding="0" >'; print "<form id=\"$id\" name=\"CDs\" method=\"post\" >"; echo '<tr class="commentContainer" style="color:#FFF">'; echo"<td><input type=\"text\" name=\"team_name\" value=\"$row[team_name]\"</td>"; echo"<td><input type=\"text\" name=\"reg_id\" value=\"$id\"</td>"; echo"<td><input type=\"text\" name=\"team_level\" value=\"$row[team_level]\"</td>"; echo"<td><input type=\"text\" name=\"notes\" value=\"$row[comments]\"</td>"; echo"<td>"; echo "<td class=\"delete\" align=\"center\" id=".$row['reg_id']." width=\"10\"><a href=\"#\" id=\"$row[reg_id]\"><img src=\"admin/images/delete.png\" border=\"0\" ></a></td>"; echo "<td class=\"approve\" align=\"center\" id=".$id." width=\"10\"><a href=\"#\" ><img src=\"admin/images/approve.png\" border=\"0\" ></a></td>"; echo "</td>"; echo"</tr>"; echo "</form>"; echo ' </table>'; } My AJAX <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { <!--$('#load').hide();--> }); $(function() { $(".approve").click(function() { var commentContainer = $(this).parent('tr:first'); var id = $(this).attr("id"); var string = 'id='+ id; var formData = $(this).attr("id") $.ajax({ type: "POST", url: "approve.php", data: $(formData).serialize(), cache: false, success: function(){ commentContainer.slideUp('slow', function() {$(this).remove();}); } }); return false; }); }); </script>
-
I'm using a spry dataset to view data off an .xml file for an online store. There's your basic stuff, picture link, headline, price, description, item number etc. The description set can vary as descriptions do with different items I'd like to only show the first few lines (140 characters or something) of the description upon load and then allow the visitor to toggle open the rest of the description. Is there a way to do that? Here is the code I'm currently using, just your basic dreamweaver insert. <div spry:region="catalog" class="SpotlightAndStacked"> <div spry:repeat="catalog" class="SpotlightAndStackedRow"> <div class="SpotlightContainer"> <div class="SpotlightColumn"><a href="_images/catalog/Art/{Picture_File}" title=" {Headline}"><img src="_images/catalog/thumbs/Art/{Thumbnail}"></a></div> </div> <div class="StackedContainer"> <div class="StackedColumn"> {Item_Last_Name}, {Item_First_Name}</div> <div class="StackedColumn"> {Item_Code_Number}</div> <div class="StackedColumn"> {Headline}</div> <div class="StackedColumn"> {Complete_Description}</div> <div class="StackedColumn"> {Item_Code_Number}</div> <div class="StackedColumn"> <strong>Retail price: {Retail_Price}</strong></div> </div> <br style="clear:both; line-height: 0px" /> </div> </div> my friend gave me this code but doesn't seem to work: <div spry:region="catalog" class="SpotlightAndStacked"> <div spry:repeat="catalog" class="SpotlightAndStackedRow"> <div class="SpotlightContainer"> <div class="SpotlightColumn"><a href="_images/catalog/Art/{Picture_File}" title=" {Headline}"><img src="_images/catalog/thumbs/Art/{Thumbnail}"></a></div> </div> <div class="StackedContainer"> <a href="#">Show Description</a> <div class="StackedInner" style="display:none"> <div class="StackedColumn"> {Item_Last_Name}, {Item_First_Name}</div> <div class="StackedColumn"> {Item_Code_Number}</div> <div class="StackedColumn"> {Headline}</div> <div class="StackedColumn"> {Complete_Description}</div> <div class="StackedColumn"> {Item_Code_Number}</div> <div class="StackedColumn"> <strong>Retail price: {Retail_Price}</strong> </div> </div> </div> <br style="clear:both; line-height: 0px" /> </div> </div> Jquery $(document).ready(function(){ $('.StackedContainer a').on('click',function(event){ event.preventDefault(); // prevent the link from any action var thisBtn = $(this); // cache thisBtn.parent().find('.StackedInner').toggle(); // toggle the description }); // close on click })
-
Hi All, I want to ask you about my calendar appointment. The problem in my calendar is when user A insert new agenda, user B must refresh it manually for can see the changes. I've used an auto div refresh which is refresh page automatically but it still didn't work. The problem is in my calendar have a nex and previous button to see the other months. When I'm access my calendar for first time, it works fine (user B don't need refresh it manually). But when I click the previous next button, user B must refresh it manually again. Can you show me where can I fix my code ? Here's the calendar file before spiltted into two parts. <?php include "connection.php"; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Agenda</title> </head> <body> <?php $monthNames = Array("January","February","March","April","May","June","July","August","September","October","November", "December"); if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n"); if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y"); $cMonth = $_REQUEST["month"]; $cYear = $_REQUEST["year"]; $prev_year = $cYear; $next_year = $cYear; $prev_month = $cMonth-1; $next_month = $cMonth+1; if ($prev_month == 0 ) { $prev_month = 12; $prev_year = $cYear - 1; } if ($next_month == 13 ) { $next_month = 1; $next_year = $cYear + 1; } ?> <table width="200"> <tr align="center"> <td bgcolor="#999999" style="color:#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%" align="left"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $prev_month . "&year=" . $prev_year; ?>" style="color:#FFFFFF">Previous</a></td> <td width="50%" align="right"><a href="<?php echo $_SERVER["PHP_SELF"] . "?month=". $next_month . "&year=" . $next_year; ?>" style="color:#FFFFFF">Next</a></td> </tr> </table> </td> </tr> </table> <tr> <td align="center"> <table width="100%" border="1" cellpadding="2" cellspacing="2"> <tr align="center"> <td colspan="7" bgcolor="#999999" style="color:#FFFFFF"><strong><?php echo $monthNames[$cMonth-1].' '.$cYear; ?></strong></td> </tr> <tr> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>M</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>W</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>F</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> </tr> <?php $timestamp = mktime(0,0,0,$cMonth,1,$cYear); $maxday = date("t",$timestamp); $thismonth = getdate ($timestamp); $startday = $thismonth['wday']; for ($i=0; $i<($maxday+$startday); $i++) { //echo "<a href=2.php>".$i."</a><br>"; if(($i % 7) == 0 ) { echo ""; } if($i < $startday) { echo "<td></td>\n"; }else { $sql = "select * from agenda where date='".($i - $startday + 1).'-'.$cMonth.'-'.$cYear."'"; $hs = mysql_query($sql); $jmlAcara = mysql_num_rows($hs); echo "<td align='center' valign='middle' height='20px'".($jmlAcara > 0 ? " bgcolor='yellow'" : '').">"; echo "<a href=2.php?tgl=".urlencode($i - $startday + 1)."&month=".urlencode($monthNames[$cMonth-1])." onclick=\"window.open(this.href,'window','width=640,height=480,resizable,scrollbars,toolbar,menubar') ;return false;\">".($i - $startday + 1)."</a><br>"; echo "</td>\n"; } if(($i % 7) == 6 ) { echo "</tr>\n"; } } ?> The I split up the file into two parts.The first is index.php who will refresh the user.php file every 1000ms. <?php include "connection.php"; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Agenda</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $.ajaxSetup( { cache: false }); // This part addresses an IE bug. without it, IE will only load the first number and will never setInterval(function() { $('#result').load('user.php'); }, 1000); // the "3000" here refers to the time to refresh the div. it is in milliseconds. }); </script> </head> <body> <?php $monthNames = Array("January","February","March","April","May","June","July","August","September","October","November", "December"); if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n"); if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y"); $cMonth = $_REQUEST["month"]; $cYear = $_REQUEST["year"]; $prev_year = $cYear; $next_year = $cYear; $prev_month = $cMonth-1; $next_month = $cMonth+1; if ($prev_month == 0) { $prev_month = 12; $prev_year = $cYear - 1; } if ($next_month == 13) { $next_month = 1; $next_year = $cYear + 1; } ?> <table width="200"> <tr align="center"> <td bgcolor="#999999" style="color:#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="50%" align="left"><a href="<?php echo "cal.php?month=". $prev_month . "&year=" . $prev_year; ?>" style="color:#FFFFFF">Previous</a></td> <td width="50%" align="right"><a href="<?php echo "cal.php?month=". $next_month . "&year=" . $next_year; ?>" style="color:#FFFFFF">Next</a></td> </tr> </table> </td> </tr> </table> <tr> <div id="result"> The second file is user.php which contains the calendar. <?php include "connection.php"; $monthNames = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"); if (!isset($_REQUEST["month"])) $_REQUEST["month"] = date("n"); if (!isset($_REQUEST["year"])) $_REQUEST["year"] = date("Y"); $cMonth = $_REQUEST["month"]; $cYear = $_REQUEST["year"]; $month=$_GET["month"]; $year=$_GET["year"]; $prev_year = $cYear; $next_year = $cYear; $prev_month = $cMonth-1; $next_month = $cMonth+1; if ($prev_month == 0) { $prev_month = 12; $prev_year = $cYear - 1; } if ($next_month == 13) { $next_month = 1; $next_year = $cYear + 1; } //$m=$_GET["month"]; //$y=$_GET["year"]; ?> <table width="100%" border="1" cellpadding="2" cellspacing="2"> <tr align="center"> <td colspan="7" bgcolor="#999999" style="color:#FFFFFF"><strong><?php echo $monthNames[$cMonth-1].' '.$cYear; ?></strong></td> </tr> <tr> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>M</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>W</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>T</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>F</strong></td> <td align="center" bgcolor="#999999" style="color:#FFFFFF"><strong>S</strong></td> </tr> <?php $timestamp = mktime(0,0,0,$cMonth,1,$cYear); $maxday = date("t",$timestamp); $thismonth = getdate ($timestamp); $startday = $thismonth['wday']; for ($i=0; $i<($maxday+$startday); $i++) { //echo "($maxday+$startday)"; //echo "<a href=2.php>".$i."</a><br>"; if(($i % 7) == 0 ) { echo ""; } if($i < $startday) { echo "<td></td>\n"; }else { $sql = "select * from agenda where date='".($i - $startday + 1).'-'.$cMonth.'-'.$cYear."'"; $hs = mysql_query($sql); $jmlAcara = mysql_num_rows($hs); echo "<td align='center' valign='middle' height='20px'".($jmlAcara > 0 ? " bgcolor='yellow'" : '').">"; echo "<a href=2.php?tgl=".urlencode($i - $startday + 1)."&month=".urlencode($monthNames[$cMonth-1])." onclick=\"window.open(this.href,'window','width=640,height=480,resizable,scrollbars,toolbar,menubar') ;return false;\">".($i - $startday + 1)."</a><br>"; echo "</td>\n"; //echo "$cMonth"; } if(($i % 7) == 6 ) { echo "</tr>\n"; } } ?> Thank you.. Regards, Ikram
-
Hello, I have founde this tutorial: http://www.hdeya.com/blog/2009/05/sorting-items-on-the-fly-ajax-using-jquery-ui-sortable-php-mysql/comment-page-1/#comment-865 I tried to do it, but I can't get the setup of my database to work as you can see here: http://www.danieldoktor.dk/jQuery%20UI%20Sortable%2C%20PHP%20%26%20MySQL/menu_list.php My domain is hosted by www.one.com, so I know it is possible, and I have installed wordpress on my server too. Can someone help Daniel
-
I have inserted a jquery in my html page but it is not fading out <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <link href="programmers.css" rel="stylesheet" type="text/css" /> <?php include('conn.php'); include('header.php'); ?> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>User Allotment</title> <script src="//ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $("#detail").hide(); $("#view").click(function() { $("#form").fadeout(); $("#detail").fadeIn(); }); }); </script> </head> <body> <form id="form1" name="form1" method="post" action="" id="form"> <table align="center" width="100%" id="form"> <tr> <td height="25" width="100%" bgcolor="#CCCCCC" align="center"><a href="user_allotment.php">User Allotment</a> <a href="view_users.php">View Users</a> <a href="">Pending Aprovals</a> <a href="freelancers_pending.php">Freelancer Pending</a> <a href="search.php">Search</a> <a href="admin_login.htm">Logout</a></td> </tr> <tr> <td><br/> <table width="1019" border="1" align="center" bgcolor="#FFFFFF"> <tr> <td colspan="13" align="center"><strong>PENDING APPROVALS</strong></td> </tr> <tr align="center"> <td width="60" align="center" >Id</td> <td width="60" align="center">First Name</td> <td width="60" align="center">Last Name</td> <td width="65" align="center">Company</td> <td width="50" align="center">Phone</td> <td width="40" align="center">Ext</td> <td width="50" align="center">E-mail</td> <td width="70" align="center">Skill required</td> <td width="75" align="center">Experience</td> <td width="70" align="center">Duration of hire</td> <td width="70" align="center">Location of hire</td> <td width="110" align="center">Brief project description</td> <td width="60" align="center">view</td> </tr> <?php mysql_select_db("programmers") or die(mysql_error()); $data = mysql_query("SELECT * FROM hire") or die(mysql_error()); while($info = mysql_fetch_array( $data )) { ?> <tr> <td><?php echo $info['id'];?></td> <td><?php echo $info['fname'];?></td> <td><?php echo $info['lname'];?></td> <td><?php echo $info['cname'];?></td> <td><?php echo $info['cnum'];?></td> <td><?php echo $info['enum'];?></td> <td><?php echo $info['email'];?></td> <?php $id=$info['id']; $fetch=mysql_query("SELECT sname FROM skill WHERE id=$id"); while($row=mysql_fetch_array($fetch)) { $sname=$row['sname']; $sk[]=$sname; } $arr=implode(',',$sk); ?> <td><?php echo $arr;?></td> <td><?php echo $info['exnum'];?></td> <td><?php echo $info['dnum'];?></td> <td><?php echo $info['lhname'];?></td> <td><?php echo $info['task'];?></td> <td><label><input type="button" class="view" id="view" value="view"/></label></td> </tr> <?php } ?> </table> </td> </tr> </table> </form> </body> </html> <?php include('footer.php'); ?>
-
I have a sidebar on a page, this will contain facebook and twitter feeds, however if I put jquery tabs on the page outside of the sidebar, the tab content only shows after the height of the sidebar HTML <div id="sidebar1"> <h3>Sidebar1 Content</h3> <p>The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. </p> <p>Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.</p> <!-- end #sidebar1 --><!--</div> --> <div id="mainContent"><!-- InstanceBeginEditable name="main-content" --> <h1>Charges</h1> <div id="tabs"> <ul> <li><a href="#tabs-1">Details</a></li> <li><a href="#tabs-2">Feedback</a></li> </ul> <div id="tabs-1"> <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p> </div> <div id="tabs-2"> <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p> </div> </div> sidebar css .twoColFixRtHdr #sidebar1 { float: right; /* since this element is floated, a width must be given */ width: 200px; /* the actual width of this div, in standards-compliant browsers, or standards mode in Internet Explorer will include the padding and border in addition to the width */ padding: 15px 10px; } any ideas why?
-
I have a search results page, and when someone clicks on the next link, or a higher page number, I want the current results to slide out to the left, whilst the new ones slide in from the right. Then if someone clicks on previous or a lower page number I want the current results to slide out to the right, and the new ones to slide in from the left. Also if possible can it change the url when the new results come in? I want to use jquery, and was wondering what is the best way to do this, would it be using animate? I have tried but cant seem to work it out.
-
Okay here is what I have in the works. What I want to achieve is the ability to update the order of items in a database upon change and if an item is moved from one tab to another it will update as well. <?php include ('global.php') ; ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>IT WHITEBOARD</title> <link rel="stylesheet" href="css/jquery-ui.css" /> <script src="jquery-1.8.3.js"></script> <script src="jquery-ui.js"></script> <style> #sortable1 li, #sortable2 li, #sortable3 li, #sortable4 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 100%; } </style> <script> $(function() { $( "#sortable1, #sortable2, #sortable3, #sortable4" ).sortable().disableSelection(); var $tabs = $( "#tabs" ).tabs(); var $tab_items = $( "ul:first li", $tabs ).droppable({ accept: ".connectedSortable li", hoverClass: "ui-state-hover", drop: function( event, ui ) { var $item = $( this ); var $list = $( $item.find( "a" ).attr( "href" ) ) .find( ".connectedSortable" ); ui.draggable.hide( "slow", function() { $tabs.tabs( "select", $tab_items.index( $item ) ); $( this ).appendTo( $list ).show( "slow" ); }); } }); }); </script> </head> <body> <div id="tabs"> <ul> <li><a href="#tabs-1">Emergency Tasks</a></li> <li><a href="#tabs-2">Priority Tasks</a></li> <li><a href="#tabs-3">Issues List</a></li> <li><a href="#tabs-4">Completed Tasks</a></li> </ul> <div id="tabs-1"> <ul id="sortable1" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result1 = mysql_query("SELECT * FROM tasks WHERE priority = 'Emergency' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result1)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result1) ; ?> </ul> </div> <div id="tabs-2"> <ul id="sortable2" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result2 = mysql_query("SELECT * FROM tasks WHERE priority = 'Priority' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result2)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result2) ; ?> </ul> </div> <div id="tabs-3"> <ul id="sortable3" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result3 = mysql_query("SELECT * FROM tasks WHERE priority = 'Issues' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result3)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result3) ; ?> </ul> </div> <div id="tabs-4"> <ul id="sortable4" class="connectedSortable ui-helper-reset"> <?php // Database Connection mysql_connect("$dbhost","$dbuser","$dbpasswd") ; // Database Selection mysql_select_db("$dbname") ; // Validate Connection $result4 = mysql_query("SELECT * FROM tasks WHERE priority = 'Completed' ORDER BY order_no ASC") ; while($row = mysql_fetch_array($result4)) { $job_name = $row['job_name'] ; echo '<li class="ui-state-default"><a href="/">'.$job_name.'</a></li>' ; } // Close Query mysql_close($result4) ; ?> </ul> </div> </div> </body> </html> I have also attached the CSS file if needed. All other .js files are standard jQuery Libary.
-
Hi I am having a conflict with these two jquery libraries I have tried noConflict but that has not worked. Jquery 1.4.2 and Jquery 1.8.3 conflict On suggestions on what I can do or where I can look to fix this issue?
-
Hello guys, I'm building a website for tablets and i want o add the ability for the user to swipe down to another div. I've found some jquery plugins for this but only for left/right, and from some blogs that jquery doesn't support this ? Is that true and how can i overcome this ? I don't know javascript/jquery and i'd like some help.
-
- javascript
- jquery
-
(and 2 more)
Tagged with:
-
Hi, In my project I am calling ul and li data in Iframe and when I click on link then it move fucus on top instead of selected item. Following is the example of the problem. testFrame.htm <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Tree Frame</title> </head> <body> <table width="50%" border="0"> <tr id="frameRow"> <td> <iframe id="treeFrame" src="treeFrame2.htm" width="50%" height="100%" scrolling="yes" frameborder="0"> </iframe> <td> </tr> </table> </body> </html> testFrame2.htm <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Test Frame2</title> <script language="javascript" type="text/javascript"> function focusMe(id) { documentBygetelementsbyid(id).focus(); } </script> </head> <body> <ul> <li><a href="#" id="1" onclick="javascript:focusMe('1');">menu1</a></li> <li><a href="#" id="2" onclick="javascript:focusMe('2');">menu2</a></li> <li><a href="#" id="3" onclick="javascript:focusMe('3');">memnu3</a></li> <li><a href="#" id="4" onclick="javascript:focusMe('4');">menu4</a></li> <li><a href="#" id="5" onclick="javascript:focusMe('5');">menu5</a></li> <li><a href="#" id="6" onclick="javascript:focusMe('6');">menu6</a></li> <li><a href="#" id="7" onclick="javascript:focusMe('7');">menu7</a></li> <li><a href="#" id="8" onclick="javascript:focusMe('8');">menu8</a></li> <li><a href="#" id="9" onclick="javascript:focusMe('9');">menu9</a></li> <li><a href="#" id="10" onclick="javascript:focusMe('10');">menu10</a></li> <li><a href="#" id="11" onclick="javascript:focusMe('11');">menu11</a></li> <li><a href="#" id="12" onclick="javascript:focusMe('12');">menu12</a></li> <li><a href="#" id="13" onclick="javascript:focusMe('13');">menu13</a></li> <li><a href="#" id="14" onclick="javascript:focusMe('14');">menu14</a></li> <li><a href="#" id="15" onclick="javascript:focusMe('15');">menu15</a></li> </ul> </body> </html> Any solution? - Thanks Zohaib.
-
Hello, i have small problem with replacing croatian letters. I am using jQuery, and am trying to replace croatian letters č,ć,š,đ,ž but dunno how to put this in regex. For now i have regex for all chars: $('#text').replace(/\b[a-z]/g, 'somechars' ); Unfortunately it wont reconize croatian special letters. Thanks. Regards
- 5 replies
-
- regex
- croatian letters
-
(and 1 more)
Tagged with:
-
I have created a slider using CSS3 to display my testimonials.. Now I need to add some animation to this slider using Jquery. But I dont have any idea how to use Jquery with this slider.. and what are the suitable plugin for this. So anybody can tell me How can I add an animation to this slider? This is my slider with HTML and CSS ...http://jsfiddle.net/XJVYj/82/ any ideas are greatly appreciated. Thank you.
-
Hey all so Im trying to put data through an AJAX call into this div <div class="scroll-pane2 blue small" style=""> <p id="bulletinBodyArea" style="margin-right:20px;"></p> </div> The AJAX is being triggered when one clicks on one of the links being fed from the database <div class="bulletinSectionAccordion rounded"> <p class="blue" style="font-size:19px;margin-left:23px;margin-top:15px;margin-bottom:10px;">Archives</p> <?php $query = "SELECT * FROM `bulletin` LEFT JOIN `bulletininschool` ON `bulletin`.`id`=`bulletininschool`.`bulletin` WHERE `school` = 2 "; $result=$connection->query($query); while($row = $result->fetch_array()) { echo '<p class="medium titi" style="margin-left:23px;">'.$row['title'].'</p>'; } ?> </div> It gets called and then passes the data $(".titi").click( getBody ); function getBody(){ $("#bulletinBodyArea").load('update/getBody.php'); }; And this is the AJAX function <?php $section='bulletin'; $table="bulletin"; $schoolSelectorTable="bulletininschool"; $schoolSelector="bulletin"; $db_host = "localhost"; $db_user = "root"; $db_pass = ""; $db_name = "isl"; mysql_connect($db_host, $db_user, $db_pass, $db_name); mysql_select_db("isl") or die(mysql_error()); $states = mysql_query("SELECT * FROM `bulletin` LEFT JOIN `bulletininschool` ON `bulletin`.`id`=`bulletininschool`.`bulletin` WHERE `school` = 2" ); while($state = mysql_fetch_array($states)){ echo "<p>".$state['body']."</p>"; } ?> Now the links that one clicks that are fed from the database are actually article titles, and when one clicks on a specific title the AJAX call should go and fetch the body text associated with that article. But I'm having trouble understanding how I should go through that. I'm doing the correct queries and getting the titles and the bodies but I just cant figure out how to associate them. Do I pass a variable to the AJAX call? Thank you
-
Hi , m writing a code to add some dynamic values , following is my code which is currently hardcoded <!DOCTYPE html> <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $.post("Myfile.php", { name:"Donald Duck", city:"Duckburg" }, function(data,status){ alert("Data: " + data + "\nStatus: " + status); }); }); }); </script> </head> <body> <button>Send an HTTP POST request to a page and get the result back</button> <input type="text" id="txt1"> </body> </html> Now i want to send some value in city : entered from the text filed , i used city :$('input[type=text]').val() but it did not work Please Suggest. Thanks!!!
- 1 reply
-
- dynamicvalues
- jquery
-
(and 1 more)
Tagged with:
-
Hi, I am trying to post checked off items to a mysql table using php and jQuery serialize(). I have the form made with array as name but I dont know where to go now. Here is my form: <form name="myform"> <input type="checkbox" name="clientId[]" value="10"> - Fred <br /> <input type="checkbox" name="clientId[]" value="20"> - Mary <br /> <input type="checkbox" name="clientId[]" value="30"> - Bob <br /> <input type="hidden" name="campaignId" value="2"> <input name="submit" type="button" value="Submit"> </form> MySql table id - auto increment clientId campaignId If I check off Fred and Mary for instance I want the clientId and campaignId to post to above table for only Fred and Mary.
-
I have use this This to make add/remove select list <form action="home.php?action=test" method="post" id="myform" name="myform" onsubmit="ValidatePageForm()"> <fieldset> <select name="selectfrom" id="select-from" multiple size="5"> <option value="1">Item 1</option> <option value="2">Item 2</option> <option value="3">Item 3</option> <option value="4">Item 4</option> </select> <a href="Javascript:void(0);" id="btn-add">Add »</a> <a href="Javascript:void(0);" id="btn-remove">« Remove</a> <select name="selectto" id="select-to" multiple size="5"> <option value="5">Item 5</option> <option value="6">Item 6</option> <option value="7">Item 7</option> </select> </fieldset> <input name="submit" type="submit" value="submit" /> </form> using below script i can see values of selected options <script type="text/javascript"> function ValidatePageForm() { $('#select-to option').each(function(){ alert($(this).val()); }); } </script> But how can i take these values and store them in database?? because when i submit i dont get see data in post dump. any help regarding this please. Thanks, Shahzad
-
I don't know the syntax , couldn't find anything similar on the net please help : Code: <script type="text/javascript"> var u=$('#2').find('tbody > tr').size(); <%section name='i' start=0 loop=u%> alert('in loop'); <%/section%> </script>
- 1 reply
-
- smarty
- javascript
-
(and 1 more)
Tagged with:
-
I have two columns in a table , first column has a select and the second has a list of checkboxes I'm using smarty to get the number of rows of the table from php , then I use a loop in script code to generate onchange event for every select cell in the table , I'm lost with syntax ! what I want that when I change the select options the checkboxes in the second cloumn become readonly or not . depeanding on the select option which has been chosen . when I open the source of the page I find that there's no code generated in the script at all , it's like the smarty code is ignored need your help to fing the error . the script : <script type="text/javascript"> $(document).ready(function() { <%section name='i' start=0 loop=$rows_number%> $('col_order<%$smarty.section.i.index%>').change(function(){ if( $('col_order<%$smarty.section.i.index%>').val=='first') { $("col_list<%$smarty.section.i.index%>_0").attr('selected','y'); $("col_list<%$smarty.section.i.index%>_0").attr('disabled',false); $("col_list<%$smarty.section.i.index%>_1").attr('selected','y'); $("col_list<%$smarty.section.i.index%>_1").attr('disabled',false); } else if( $('col_order<%$smarty.section.i.index%>').val=='second') { $("col_list<%$smarty.section.i.index%>_0").attr('selected','n'); $("col_list<%$smarty.section.i.index%>_0").attr('disabled',true); $("col_list<%$smarty.section.i.index%>_1").attr('selected','n'); $("col_list<%$smarty.section.i.index%>_1").attr('disabled',true); } }); }); <%/section%> </script>
-
hi friends, im trying a case, n i have problem on it, im gonna input multiple data , here sample my form html: <div id="form_name"> <select id="name_emp"> <option value="1234">joko</option> <option value="9900">Rudi</option> <option value="7786">anto</option> </select> <div id="id_emp"> </div> </div> <button id="addBtn">Add Name</button> n i want, for example, a user can show that select elemen above more than 1, so i create jquery code below: $("#addBtn").click(function() { $("#form_name").append('<select id="name_emp"><option value="1234">joko</option><option value="9900">Rudi</option> <option value="7786">anto</option> </select> <div id="id_emp"> </div>'); }); so, if a user click Add Name button, the select elemen wil show again. after a user choose from select elemen, i want jquery show the ID, example, if i choose joko, ID will show 1234 n so forth. so i create jquery code below: $('#name_emp').change(function() { var ID = $("#name_emp").val(); $('#id_emp').html(ID); }); it works when i choose the name n the ID is out between <div id="id_emp"></div> at first time, but, when i click Add Name button to show again the select elemen, n i choose employee name, the ID is not out,that's my problem friends, can you help me? thanks before....
-
Having issue trying to sum list/menu selected values to show on a textbox <!DOCTYPE html> <html> <head> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript" src="js/jquery-1.4.2.js"></script> <style> p { color:red; margin:4px; } b { color:blue; } </style> </head> <body> <p><input name="wal" id="wal" type="text"></p> <p><input type="text" id="total" value="0"></p> <select size="7" multiple="multiple" id="multiple"> <option value="1" selected="selected">Item 1</option> <option value="2">Item 2</option> <option value="3">Item 3</option> <option value="4">Item 4</option> </select> <script> function displayVals() { var multipleValues = $("#multiple").val() || []; $("#wal").val( multipleValues.join("+ ")); var total =($('#wal').val()); // Update the total var postid=total.split("+"); var sum = 0; //iterate through each textboxes and add the values $("#wal").each(function() { //add only if the value is number if(!isNaN(this.value) && this.value.length!=0) { sum += parseFloat(this.value); } }); //.toFixed() method will roundoff the final sum to 2 decimal places $("#total").html(sum.toFixed(2)); } $("select").change(displayVals); displayVals(); </script> </body> </html> Can anyone help with this please
-
- javascript
- sum
-
(and 1 more)
Tagged with:
-
Hello, I am trying to load more search resutls in my search.php with this code <script> function yHandler($q){ var result= document.getElementById('mydiv'); var contentHeight = result.offsetHeight; var yOffset = window.pageYOffset; var y = yOffset + window.innerHeight; if(y >= contentHeight){ var query = "<?PHP echo $_POST['search']?>"; $.ajax({ type: "POST", url: "search.php", $q:query, success: function(res) { $("#more").append(res); } }); } } window.onscroll = yHandler; </script> My biggest problem is that it will load the page with no results because the $q is not correctly sent. If I try alert(query); it shows the search term so the problem must be when im defining my data in the ajax request. Any ideas? Thanks in advance
- 1 reply
-
- jquery
- javascript
-
(and 2 more)
Tagged with: