Jump to content

Search the Community

Showing results for tags 'jquery'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Hello, first I would like to note that I found this-- http://forums.phpfreaks.com/topic/187247-display-results-upon-drop-down-selection-phpmysql/?hl=%2Bdisplay+%2Bresults+%2Bfrom+%2Bdrop+%2Bdown+%2Bmenu&do=findComment&comment=988883 --post very similar to my question but I just could not figure it out. It wouldn't work with my type of code or maybe I simply missed something. Alright, well basicly I have a drop down menu working now all I want to do is to display the description(for now) in the section to the right of my drop down menus. In my database the column is call "description" and it is in my destination table. Here is my code that I have so far... The Javascript <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("#flip").click(function() { jQuery("#panel").slideToggle("slow"); }); jQuery(".wrap").on('change', '#country',function() { var querystr = 'countryid='+jQuery('#country :selected').val(); jQuery.post("<?php echo plugins_url(); ?>/Destination_Drop_Down_Menu/ajax.php", querystr, function(data){ if(data.errorcode == 0){ jQuery('#statecbo').html(data.chtml) }else{ jQuery('#statecbo').html(data.chtml) } }, "json"); }); jQuery(".wrap").on('change', '#states', function() { var querystr1 = 'stateid=' +jQuery('#states :selected').val(); jQuery.post("<?php echo plugins_url(); ?>/Destination_Drop_Down_Menu/ajax.php", querystr1, function(data) { if(data.errorcode ==0){ jQuery('#citycbo').html(data.chtml) }else{ jQuery('#citycbo').html(data.chtml) } }, "json"); }); jQuery(".wrap").on('change', '#city', function() { var querystr2 = 'cityid=' +jQuery('#city :selected').val(); jQuery.post("<?php echo plugins_url(); ?>/Destination_Drop_Down_Menu/ajax.php", querystr2, function(data) { if(data.errorcode ==0){ jQuery('#descbo').html(data.chtml) }else{ jQuery('#descbo').html(data.chtml) } }, "json"); }); }); </script> <html> <head> <title>Dynamic Drop Down Menu</title> </head> <body> <div class="wrap"> <h2> Country</h2> <select id="country" name="country" required> <option value="">--Select Country--</option> <?php $sql=mysql_query("SELECT * from country order by name"); while ($row=mysql_fetch_array($sql)) { $countryID=$row['IDCountry']; $countryname=$row['name']; echo "<option value='$countryID'>$countryname</option>"; } ?> </select> </div> <h2>State</h2> <div class="wrap" id="statecbo"> </div> <h2>City</h2> <div class="wrap" id="citycbo"> </div> <h2>Destination</h2> <div class="wrap" id="descbo"> </div> and here is my ajax.php file $country_id = isset($_POST['countryid']) ? $_POST['countryid'] : 0; if ($country_id <> 0) { $errorcode = 0; $strmsg = ""; $sql="SELECT * from state WHERE IDCountry = ". $country_id . " ORDER BY name;"; $result=mysql_query($sql); $cont=mysql_num_rows($result); if(mysql_num_rows($result)){ $chtml = '<select name="states" id="states"><option value="0">--Select State--</option>'; while($row = mysql_fetch_array($result)){ $chtml .= '<option value="'.$row['IDState'].'">'.$row['name'].'</option>'; } $chtml .= '</select>'; echo json_encode(array("errorcode"=>$errorcode,"chtml"=>$chtml)); }else{ $errorcode = 1; $strmsg = '<font style="color:#F00;">No States available</font>'; echo json_encode(array("errorcode"=>$errorcode,"chtml"=>$strmsg)); } } $state_id = isset($_POST['stateid']) ? $_POST['stateid'] : 0; if ($state_id <> 0) { $errorcodeC = 0; $strmsg = ""; $sqlC="SELECT * from city WHERE IDState = ". $state_id . " ORDER BY name;"; $resultC=mysql_query($sqlC); $contC=mysql_num_rows($resultC); if(mysql_num_rows($resultC)){ $chtmlC = '<select name="city" id="city"><option value="0">--Select city--</option>'; while($row = mysql_fetch_array($resultC)){ $chtmlC .= '<option value="'.$row['IDCity'].'">'.$row['name'].'</option>'; } $chtmlC .= '</select>'; echo json_encode(array("errorcode"=>$errorcodeC,"chtml"=>$chtmlC)); }else{ $errorcodeC = 1; $strmsg = '<font style="color:#F00;">No city available</font>'; echo json_encode(array("errorcode"=>$errorcodeC,"chtml"=>$strmsg)); } } $city_id = isset($_POST['cityid']) ? $_POST['cityid'] : 0; if ($city_id <> 0) { $errorcodeD = 0; $strmsg = ""; $sqlD="SELECT * from destination WHERE IDCity = ". $city_id . " ORDER BY name;"; $resultD=mysql_query($sqlD); $contD=mysql_num_rows($resultD); if(mysql_num_rows($resultD)){ $chtmlD = '<select name="destination" id="destination"><option value="0">--Select Destination--</option>'; while($row = mysql_fetch_array($resultD)){ $chtmlD .= '<option value="'.$row['IDDestination'].'">'.$row['name'].'</option>'; } $chtmlD .= '</select>'; echo json_encode(array("errorcode"=>$errorcodeD,"chtml"=>$chtmlD)); }else{ $errorcodeD = 1; $strmsg = '<font style="color:#F00;">No Destination available</font>'; echo json_encode(array("errorcode"=>$errorcodeD,"chtml"=>$strmsg)); } } Any help would be greatly appreciated. I am also about two weeks into learning how to program so basic explanations would help me learn alot! Thank you!
  2. I have this button for my like system and for some reason i have to refresh after i click it again... i would like it to be that when i click it it changes the class and i can click it again and do the other function... please help thank you... JQUERY: <script type="text/javascript"> $(document).ready(function(){ $('[name="like"]').on("click", function(){ if($(this).attr('title')=='like'){ $.post('/like.php',{imid:$(this).attr('id'),action:'like'}); $(this).removeClass('like').addClass('unlike'); $(this).attr('title','unlike'); $(this).attr('name','unlike'); } }); $('[name="unlike"]').on("click", function(){ if($(this).attr('title')=='unlike'){ $.post('/like.php',{imid:$(this).attr('id'),action:'unlike'}); $(this).removeClass('unlike').addClass('like'); $(this).attr('title','like'); $(this).attr('name','like'); } }); }); </script> PHP: $likes = mysql_query("SELECT lid FROM likes WHERE uid='$id' AND imid='$photoid'"); if(mysql_num_rows($likes)==0){ $likethis = '<div class="like" title="like" id="'.$photoid.'" name="like"></div>'; }else{ $unlikethis = '<div class="unlike" title="unlike" id="'.$photoid.'" name="unlike"></div>'; }
  3. I have a php and jquery like system that doesn't work for some reason? When i click on the button to like it does nothing not even gives me an error please help thank you ! Here is my code that I am using and maybe you will see something that I didn't? The first part of the php code works it shows the like button so I know that's right but when you click it, it does nothing ... PHP: $likes = mysql_query("SELECT lid FROM likes WHERE uid='$id' AND imid='$photoid'"); if(mysql_num_rows($likes)==0){ $likethis = '<a href="#" id="'.$photoid.'" title="like"><div class="like"></div></a>'; }else{ $unlikethis = '<a href="#" id="'.$photoid.'" title="unlike"><div class="unlike"></div></a>'; } JQUERY: <script type="text/javascript"> $(document).ready(function(){ $(document).bind('click', '.like', function(){ if($(this).attr('title')=='like'){ $.post('like.php',{imid:$(this).attr('id'),action:'like'},function(){ $(this).text('unlike'); $(this).attr('title','Unlike'); }); }else{ if($(this).attr('title')=='unlike'){ $.post('like.php',{imid:$(this).attr('id'),action:'unlike'},function(){ $(this).text('like'); $(this).attr('title','like'); }); } } }); }); </script> like.php: $imid=$_POST['imid']; $action=$_POST['action']; if ($action=='like'){ $sql= mysql_query("SELECT * FROM likes WHERE imid=$imid and uid=$id"); $matches=$sql->rowCount(); if($matches==0){ $sql= mysql_query("INSERT INTO likes (imid, uid) VALUES($imid, $id)"); $sql= mysql_query("UPDATE photos SET likes=likes+1 WHERE id=$imid"); }else{ die("There is No Image With That ID"); } } if ($action=='unlike'){ $sql= mysql_query("SELECT * FROM likes WHERE imid=$imid and uid=$id"); $matches=$sql->rowCount(); if ($matches!=0){ $sql=mysql_query("DELETE FROM likes WHERE imid=$imid AND uid=$id"); $sql=mysql_query("UPDATE photos SET likes=likes-1 WHERE id=$imid"); } }
  4. Hi I am trying to create a grid like gallery and for some reason it does not look right? I want it to look like pinterest so I am trying to use wookmark jquery. Here is my code and an image to view. Thank you. Here is the css: #gallerycontainer { display: inline-block; background-color: #f0f0f0; padding: 0px; width:850px; /*border: 1px solid #DBDBDB; -webkit-box-shadow: #E4E4E4 0px 0px 5px; -moz-box-shadow: #E4E4E4 0px 0px 5px; box-shadow:#E4E4E4 0px 0px 5px;*/ position:relative; left:0px; bottom:13px; overflow:inherit; top:0px; float: left; padding-right: 0px; margin-left: 10px; overflow: auto; } #gallery{ } #gallery li img { float: left; border: 5px solid #fff; -webkit-transition: box-shadow 0.5s ease; -moz-transition: box-shadow 0.5s ease; -o-transition: box-shadow 0.5s ease; -ms-transition: box-shadow 0.5s ease; transition: box-shadow 0.5s ease; max-width:250px; max-height:200px; padding:0px; } .galleryinfo{ border: 2px solid #fff; padding-bottom: 40px; float: left; margin:9px; background: white; } #gallery li img:hover { -webkit-box-shadow: 0px 0px 7px rgba(255,255,255,0.9); box-shadow: 0px 0px 7px rgba(255,255,255,0.9); cursor: pointer; } .myaccounttitle{ text-align: center; } And here is the php and html. <script type="text/javascript" src="js/jquery.wookmark.js"></script> <script type="text/javascript">$('#gallery li').wookmark();</script> <div class="myaccounttitle">My Images</div> <div id="gallery"> <?php function pictures($query) { while($row = mysql_fetch_array($query)) { $id = $row['id']; $title = $row['title']; $author = $row['userid']; $date = date("F j, Y, g:i a", $row['date']); $picture = $row['picture']; // $likes = $row['likes']; // $favs = $row['favs']; $unique = mysql_num_rows(mysql_query("SELECT * FROM views WHERE picture='$id' GROUP BY ip")); ?> <div class="galleryinfo"> <li id="<?php print $id?>"> <a class="fancybox" rel="group" href="photos/<?php print $picture?>"><img src="photos/<?php print $picture?>"/></a> </li> Views : <?php print($unique) ?> </div> <?php }}} ?> <div id="gallerycontainer"> <?php if($account == "c") { pictures($query2); }else { pictures($query); } ?> </div> All of your help is greatly appreciated.
  5. I'm looking to hire someone to build a new version of an image upload/ resize script for my admin area. I currently have one in place which is about 5 years old and now in need of a refresh. I run a high volume used car dealership and on average add about 5 vehicles into our inventory per day, with 10 - 20 pictures per vehicle. My current script is very very slow, and requires to much user input. I want the script to start once the pictures are dragged into the "area" (page, div, span, however it is coded) and save the proper order of the images when I drag them around. My current script wont start until I click start, throws a lot of errors, and wont save the proper order untill I hit save. I know that these might seem like small things to complain about but when I'm multi tasking and doing my usual 5 things at once and forget to hit "save" after dragging 20 images I get mad. I want to drag the photos and have them resized 3 times, (thumbnail, medium and large,) place them into the corresponding folder, and save the proper order of the image sequence in my dB. (My current script does do all of this, but like I said, it is very slow, and throws a ton of errors.) Facebook, Google Photos (and a ton of others) have good examples of what I'm looking for. Email me, brad@carcityofdanbury.com with and questions or with quotes and time frame needed to complete this project. The most important thing is that my current script must remain usable until the new one is complete. If your work is good I have some other things that I could possible have your help working on.
  6. Here is a script i wrote so i could refresh a div with content every 5 seconds but for some reason it doesnt work ... i wanted it to load it with the page then start the refresh i didnt want it to have to wait for the refresh to show up. <script type="text/javascript"> function page_load(){ $('#contentforads').load('<?php print $actual_link ?>/ads.php').fadeIn("slow"); } function refresh(){ page_load() var auto_refresh = setInterval(page_load(),5000); } </script>
  7. I'm trying to refresh a data input into an INPUT through a form and then SUBMIT this to the database to return it as a table on the same page. I want it to do this without showing the refresh of the page. This is what I have currently. When I put data into any of the INPUT fields and click SUBMIT nothing happens and nothing shows for an error. <?php session_start(); error_reporting (E_ALL); require '../core/cnn.php'; if(isset($_POST['submitsearchprojno'])) { $searchprojno = $_POST["searchprojno"]; } if(isset($_POST['submitsearchadd'])) { $searchaddress = $_POST["searchaddress"]; } if(isset($_POST['submitsearchpc'])) { $searchpostcode = $_POST["searchpostcode"]; } $searchpostcode = mysql_real_escape_string($searchpostcode); $searchaddress = mysql_real_escape_string($searchaddress); $searchprojno = mysql_real_escape_string($searchprojno); ?> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button> <h4 class="modal-title">Search Projects</h4> </div> <div class="modal-body"> <form class="modal-form" id="searchform" name="searchform" action="" method="post"> <div class="form-group"> <label class="col-md-4 control-label">Project Number</label> <div class="col-md-6"> <input type="text" class="form-control input-inline input-medium" name="searchprojno" id="searchprojno" placeholder="Enter Project Number"> </div> <button type="submit" class="btn blue" id="submitsearchprojno" name="submitsearchprojno" >Search <i class="m-icon-swapright m-icon-white"></i></button> </div> <div class="form-group"> <label class="col-md-4 control-label">Address</label> <div class="col-md-6"> <input type="text" class="form-control input-inline input-medium" name="searchaddress" id="searchaddress" placeholder="Enter Address"> </div> <button type="submit" class="btn blue" id="submitsearchadd" name="submitsearchadd" >Search <i class="m-icon-swapright m-icon-white"></i></button> </div> <div class="form-group"> <label class="col-md-4 control-label">Postcode</label> <div class="col-md-6"> <input type="text" class="form-control input-inline input-medium" name="searchpostcode" id="searchpostcode" placeholder="Enter Postcode"> </div> <button type="submit" class="btn blue" id="submitsearchpc" name="submitsearchpc" >Search <i class="m-icon-swapright m-icon-white"></i></button> </div> <div class="form-group"> <div class="col-md-12"> <div class="table-responsive"> <table class="table table-striped table-bordered table-advance table-hover"> <thead> <tr> <th class="col-md-9"><i class="fa fa-list-alt"></i> Address</th> <th class="col-md-3"></th> </tr> </thead> <tbody> <tr> <?php $searchrs = mysql_query("SELECT ProjectNo, CONCAT(COALESCE(HouseNoName, ''), ' ', COALESCE(StreetName, ''), ' ', COALESCE(TownOrCity, ''), ' ', COALESCE(Postcode, '')) AS Display, PropID, AreaID, AWGMember, Householder, HouseNoName, StreetName, TownOrCity, Postcode, ContactTelephone, AlternatePhone, Email, PropertyTenure, PropertyNotes FROM prop_property WHERE IsActive = 1 AND (Postcode = '".$searchpostcode."' OR StreetName = '".$searchaddress."' OR ProjectNo = '".$searchprojno."') ") or die(mysql_error()); $checkrs = mysql_query("SELECT * FROM prop_property WHERE IsActive = 0"); if(!mysql_num_rows($checkrs) > 0) { echo '<td> No record found!</td><td></td>'; } else { while ($results = mysql_fetch_array($searchrs)) { echo ' <td id="displayadd">'.$results['Display'].'</td> <td> <form action="../jobdetails.php" method="post"> <input type="hidden" name="searchhouse" value=" '.$results['HouseNoName'].'" > <input type="hidden" name="searchstreet" value=" '.$results['StreetName'].'" > <input type="hidden" name="searchtown" value=" '.$results['TownOrCity'].'" > <input type="hidden" name="searchpostcode" value=" '.$results['Postcode'].'" > <input type="hidden" name="searchpropid" value=" '.$results['PropID'].'" > <input type="hidden" name="searchprojectno" value=" '.$results['ProjectNo'].'" > <button type="submit" class="btn default btn-xs blue-stripe" id="viewsearch" name="viewsearch">View Address</button> </form> </td>'; } }?> </tr> </tbody> </table> </div> </div> </div> </form> <div class="modal-footer right"> <button type="button" data-dismiss="modal" class="btn default">Cancel</button> </div> <script type="text/javascript"> $(function(){ $('#searchform').on('submit', function(e){ e.preventDefault(); //alert($('#searchpostcode').val()) $.post('includes/jobdetailssearch.php', $('#searchform').serialize(), function(data, status){ $('.table-responsive #displayadd').html(data.Display); //$("#table-responsive td").last().append(data); console.log("done"); }).fail(function () { console.log("fail"); }); }); }); </script> How can I get it to POST the INPUT to the database and return in the table?
  8. Hello I'm looknig for a code that can guide me to generate four chained selects with data from mysql database, that let me add new rows to a table that maintain the same logic of the four chained select with data from mysql when I do click an add row button and so on. Anyone can give me a link or download site that I can use to build that I want? Could be a JavaScript, jquery or php code that let me do what I want in HTML. Best Regards
  9. Hi i want to change the attribute of a div id when the div is clicked.. but its not working for some reason ? $('#prev').attr('id',''); $('#next').attr('id','2'); //Pagination Click $(".controls").click(function(){ $("html, body").animate({ scrollTop: 0 }, 700); $('#next').removeattr('id',''); $('#prev').attr('id',''); $('#next').attr('id','7');
  10. Okay so i have a file that i need some php variables from. This is the code that i am using. please help ! This is the ajax that i am trying to use to get the variable and then set it to a php variable. $.ajax({ url : 'pagination_data.php?page=1', type : 'POST', data : data, dataType : 'json', success : function (result) { var k=result; <?php $next ?>=var k; }, error : function () { alert("error"); } }); Now here i am setting the varialbes in the other file. $next = $page+1; $prev = $page-1; echo json_encode($next); echo json_encode($prev); and this is where i need the variables... <?php echo "<div class='controls' id='$prev'></div><div class='controls' id='$next'>"; ?>
  11. I need help with adding some ajax to my jquery script to pass a php var to a modal. I can open the modal with the bit of jquery below but I am at a lose on how to add any ajax to this jquery script to take the $id from the link to the modal. The jquery I am opening the modal with $(document).ready(function(){ $(".launch-modal").click(function(){ $("#editexpenses").modal({ keyboard: false }); }); }); I am opening the modal with this link to the jquery <a id="<?php $id ?>" title="Edit this item" class="launch-modal" href="#editexpenses">edit</a> The modal <div class="modal fade" id="editexpenses" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> <?php $id = $_POST['expID']; echo 'id' . $id; var_dump($_POST); ?> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal -->
  12. I have started playing around with jQuery mainly to allow me to create complicated forms without clicking through several php pages collecting all the data. It's is probably not relevant but I will give the full picture of what i am attempting feel free to ignore this paragraph if it is of no use! I have a table of MySQL rows with checkboxes. There will be 3 different options for bulk processing of the checked rows and on clicking one of the options a hidden div will fade in and the options buttons will disappear (to prevent several options divs being opened at the same same). In the div there will be form elements relevant to the bulk processing option chosen. For the first one it is simply one text input. Upon Submit it will validate that the input is not empty and if so, execute the function that posts the data. The data gets posted, the div gets replaced and a success message is displayed, plus the bulk option buttons return ready to choose another option. This new div gets hidden once a bulk option next gets clicked. This all works correctly but there is an issue with clearing the validation. So the problem I actually have is that after successful validation and script execution the data is still in memory so if I run through the process again with an empty field, you see the validation error message again, briefly, but the script still runs. Is there any way to clear everything still in memory at the end of script execution? I have tried a few suggestions I have seen and a few things I have tried as a complete guess-up but no joy.... $('#bulkMatchActions').valid=false; $('#bulkMatchActions').validate=false; $('#bulkMatchActions').valid=null; $('#bulkMatchActions').validate=null; removeData(validator); removeData($.post); removeData('#bulkMatchActions'); I am sure that there must be a way to do this but I am completely stumped. If anyone can offer any suggestions I would be grateful. Also, although this code is something I am just playing around with and will not be used on a production site, if there is anything in the scripts that could be done better, feel free to say. but don't be too harsh!! Thanks in advance Steve The Validation part //Validate Defaults jQuery.validator.setDefaults({ debug: true, success: "valid" }); //Validate Rules $(function(){ var validator = $('#bulkMatchActions').validate({ rules: { ppReason:{ required: true } }, messages: { ppReason: "Please enter a reason" } }); //On Submit, run the posting script $('#postponeSubmit').click(function(){ if($('#bulkMatchActions').valid()){ postponeSubmit(); //After the above script is run, I want everything set to NOT VALID ready to validate an empty field again }else{ return false; } }); //Empty the form validator.resetForm(); }); The actual posting script //Postpone function postponeSubmit(){ $('#postponeSubmit').click(function() { var ppSubmit = 'ppSubmit'; var ppReason = $('#ppReason').val(); var checkBox = $.map($('input:checkbox:checked'), function(e,i) { return +e.value; }); var checkBox2 = $('#checkbox'); $('#postpone').fadeOut('fast'); $('#postpone2').fadeIn('fast'); $('#postpone2 p').text('Loading....'); $.post('inc/processForm.php', { ppReason : ppReason, ppSubmit : ppSubmit, checkBox : checkBox }, function(data){ $('#postpone2 p').html(data); showBulkControls(); }); }); }
  13. Hey guys, Stuck on this for a couple days now. I am using a 3rd party video gallery function that uses jquery. http://codecanyon.net/item/responsive-video-gallery-html5-youtube-vimeo/2918602 The gallery works great when the list is hard coded, but as soon as I use a PHP mysql query to echo out the list the video gallery becomes buggy and hangs (works about 25% of the time). The higher I set the limit on the query the worse it performs (works great if I limit it to only 1). Any ideas what could be the issue? I am completely out of ideas. Is my PHP code bad? This list hard coded list works perfect: <ul id='mix1' data-address="mix1"> <li data-address='youtube_single1' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/SVdc8ec_bGg?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single2' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/WwRrKaq0IyY?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single3' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/36kmXKP_l7I?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single4' data-type='youtube_single' data-path='http://gdata.you<li data-address='youtube_single5' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/WwRrKaq0IyY?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single6' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/36kmXKP_l7I?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single7' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/36kmXKP_l7I?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single8' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/36kmXKP_l7I?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single9' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/36kmXKP_l7I?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single10' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/36kmXKP_l7I?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single11' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/36kmXKP_l7I?v=2&format=5&alt=jsonc' ></li> <li data-address='youtube_single12' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/36kmXKP_l7I?v=2&format=5&alt=jsonc' ></li> </ul> Once I use the PHP query and echo for the list the gallery becomes buggy: <ul id='mix1' data-address="mix1"> <?php $query = mysql_query('SELECT video_number FROM videos WHERE video_item_id="'.$pid.'" ORDER BY RAND() LIMIT 10'); $i = 0; class myCounter implements Countable { public function count() { static $count = 0; return ++$count; } } $counter = new myCounter; while ($row = mysql_fetch_array($query)) { if($i % 10 === 0) { } echo "<li data-address='youtube_single".count($counter)."' data-type='youtube_single' data-path='http://gdata.youtube.com/feeds/api/videos/".$row['video_number']."?v=2&format=5&alt=jsonc' ></li>"; $i++; } ?> </ul>
  14. Hi friends, i am new in php, user fill the text box to get the value and post it to the next page using ajax. this is my requirement. i call the textbox in while loop ,so i used the text box name is ship_quantity[] In jquery i get the value like that $('input[name="ship_quantity[]"]').each(function(){ var sq=$(this).val(); alert(sq); now i get the value of 1,2 as user inputs. my questions is how to extract this values and send to ajax post.
  15. var latestMDPver = $.ui.multiDatesPicker.version; var lastMDPupdate = '2012-03-28'; $(function() { // Version // //$('title').append(' v' + latestMDPver); $('.mdp-version').text('v' + latestMDPver); $('#mdp-title').attr('title', 'last update: ' + lastMDPupdate); // Documentation // $('i:contains(type)').attr('title', '[Optional] accepted values are: "allowed" [default]; "disabled".'); $('i:contains(format)').attr('title', '[Optional] accepted values are: "string" [default]; "object".'); $('#how-to h4').each(function () { var a = $(this).closest('li').attr('id'); $(this).wrap('<'+'a href="#'+a+'"></'+'a>'); }); $('#demos .demo').each(function () { var id = $(this).find('.box').attr('id') + '-demo'; $(this).attr('id', id) .find('h3').wrapInner('<'+'a href="#'+id+'"></'+'a>'); }); // Run Demos $('.demo .code').each(function() { eval($(this).attr('title','NEW: edit this code and test it!').text()); this.contentEditable = true; }).focus(function() { if(!$(this).next().hasClass('test')) $(this) .after('<button class="test">test</button>') .next('.test').click(function() { $(this).closest('.demo').find('.box').removeClass('hasDatepicker').empty(); eval($(this).prev().text()); $(this).remove(); }); JS FIDDLE LINK: http://jsfiddle.net/bJ7zj/#update When i go to the month of april and select dates, the date picker resets to march month.
  16. hello every one.... Can any one plz help me how to detect mobile device brand like samsung, nokia or micromax uisng php or javascript.... Any help will be greatly appreciated.... Thank you.. :)
  17. How can I call another script and pass a id so I can fill another drop down pulling data from mysql. I have added the scripts below I just don't understand how to call them $( document ).ready(function() { $.ajax({ //create an ajax request to load_page.php type: "GET", url: "customer.php", dataType: "html", //expect html to be returned success: function(response){ $(".responsetext").html(response); //alert(response); } }); }); THIS SCRIPT FILLES THE DROPDOWE BELOW USING responsetext <select name="customer"id="customer" class="form-control input-sm responsetext"> </select> SO WHEN I SELECT THIS IT WILL PASS THE ID AND RUN THE SCRIPT BELOW $(function() { // document.ready $("#id").on("change", function() { $.ajax({ url: "contact.php", type: "GET", data: { id: $(this).val() }, success: function(data) { $(".contactresults").html(data); } }); }); }); SO IT WILL FILL THIS SELECT BOX WITH contactresults <select name="contact" class="form-control input-sm contactresults" id="contact"> </select>
  18. Hi I'm havaing a problem with some JQM what is suppose to be happening, when the page is shown a list of data is to be shown. When you click one of the list items the popup needs to dynamically update with the text from the clicked list to display in the pop. i.e. if the item clicked is called Sales then the pop up item should be Edit Sales Here is the code I have $('#listPage').live('pagebeforeshow', function (event) { retrieveDisplayList(db, '', function (data) { tf.ui.hideLoadingMsg(); var template = Handlebars.templates.dataList(data); $("#listContainer").html(template); $('#listContainer').trigger('create'); var menuTarget = event.currentTarget; $('.listItem').click(function() { var txt = $.trim($(this).text()); var txtLabel = txt; var links = new Array(); links.push({ id: 'ID-1', page: '/index.html', name: 'Edit ' + txtLabel }); links.push({ id: 'ID-2', page: '/index.html', name: 'View Data' }); var popup = Handlebars.templates.popup({links: links}); $("#surveyPopup").html(popup); $('#surveyPopup').trigger('create'); $("#popup").popup('open', {positionTo: menuTarget}); //$('#surveyPopup').trigger('update'); }); }); });
  19. Hello everybody, I'm working on a script which has 2 div tages controled by 2 radio buttons and using jquery to hide/show the div tags based on the users selection. Like to have.. if a user selects one of the radio button i like to maintain the selection radio button and the div tag if the page is refreshed. Problem: if the user selects the second div tag and if the page refreshes the radio button and the div tag returns to the initial setup which is going back to the first radio button and div tag. how do i maintain the selection, radio button and the div tage after a refresh? <script type='text/javascript'> $(document).ready(function() { $("#DivB").hide(); $('input[name="myproject"]').change(function() { if($(this).val() == "A") { $("#DivA").show(); $("#DivB").hide(); } else { $("#DivA").hide(); $("#DivB").show(); } }); }); </script> <div style ="border:1px solid black;"> <form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='POST'> <div id="div1"> <input type='radio' name='myproject' value='A' checked="checked" <?php echo (isset($_POST['myproject']) && $_POST['myproject'] == 'A') ? 'checked':''; ?> />Have projectID <input type='radio' name='myproject' value='B' <?php echo (isset($_POST['myproject']) && $_POST['myproject'] == 'B') ? 'checked':''; ?> />Lost projectID<br /> </div> <hr /> <div id='DivA'> projectID:<br /> <input type="text" name="proId"><br /> email: <br /> <input type="text" name="email"><br /><br /> <button name="btn_prj_info">View project status</button> <br /> </div> <div id='DivB'> Email: <br /> <input type="text" name="emailR"><br /><br /> <button name="btn_email">Email information</button> <br /> </div> </form> </div>
  20. Hey Guys ! i'm not sure if i posted my topic in the right side anyway .. i have a countdown.js file everything is OK , but the big problem is the countdown not working at all ,( Days , Hours ,Min , Sec) all of this keeps in zero but the count UP work normal this is the source code : http://jsfiddle.net/NdfPR/2/ in line 29 and 30 until: new Date(2014, 4 - 1, 4, 0, 0, 0), since: null, nothing happen with this code but if i changed to this until: null, since: new Date(2014, 4 - 1, 4, 0, 0, 0), the count up will work and i don't count up ,, this js file is linked to my template so if there's anything to solve this problem ,, i'm here if i forget anything to
  21. I worked with PHP for several years, then have worked for the last 2 with Coldfusion. I do the following in coldfusion and tried the same type of thing in PHP, but PHP does not return proper results. Does anyone know how I can make this work in PHP? Any tips/help VERY much appreciated, I an my daughter have a lot of coding work waiting for this answer! Neither one of us can figure this out. Coldfusion example: //in the javascript/jquery section of the page: function getOrders(customerid){ $.get('scripts/orderrequests.cfc?method=getOrders&custid='+customerid, function(data){ document.getElementById('orderdiv').innerHTML = data; } ); } then further down on the page <a href="javascript:getOrders(#customerid#)">Click here to list all of your orders.</a><br> <div id="orderdiv"></div> --------- then, briefly... in scripts/orderrequests.cfc is the coldfusion function that gets the orders out of the database, and returns an entire html table of the orders <cfunction name="getOrders" ...> <cfargument name="custid" required="yes"/> <cfquery.... gets the order info out of db just like any mysql query basically...> <cfsavecontent variable="tableinfox"> <table> <tr><tr><td>#orderid#</td><td>#orderdate#</td></tr></table> </table> </cfsavecontent> <cfreturn tableinfox/> </cfunction> ------------------- The scenario beautifully loads the order data into the div "<div id="orderdiv"></div>" above. Been using this for two years in coldfusion, and I would LOVE to figure out how to do the same scenario in PHP, so I tried.. function getOrders(customerid){ $.get('includes/gettheorders.php?custid='+customerid, function(data){ document.getElementById('orderdiv').innerHTML = data; } ); } <?php echo '<a href="javascript:getOrders('.$customerid.');">Click here to list all of your orders.</a><br /><div id="orderdiv"></div>'; ?> Then, "includes/gettheorders.php" is just a simple php query that loads the orders into a table...outputs it to it's own page, which then should be returned as that "data" in function(data)... and loaded into the div.. "document.getElementById('orderdiv').innerHTML = data;" When I tried this with various code on "gettheorders.php", the best I can do is that, "gettheorders.php" can return ONE number "3" but not "content" like an HTML table full of content.. What do I need to do to make this kind of scenario work in PHP? I obviously want to return more content than just a number. I am so hungry for this answer, you don't even know.. but then you are programmers who have also banged your head against your desk, so I guess you do!
  22. Hello, so I am a new member here and I would need some help. I could'nt decide if I post my problem to ajax or javascript topic . I have bought dating site software called eMeeting. I tried to add a custom javascript slider to the header. The slider needs jquery library to work, but when I import the library, other scripts from the webpage stop working. So here is a quick demo. This is my sites header. When I click to "SMS Kuulutused" link (marked with red circle) this appears: So the problem is now when I click to the status box on the same page nothing happens. But if I comment the line below (located in sliders js file) <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> Other javascripts from the page will work again and the result for this demo when clicked the red circle would be this: It would be really nice if someone has some time to help me or give me some suggestions. Also the webpage is http://flirt.ee Best Regards, Mairo
  23. Hello, I'd like to know if someone know how I can do this. Example when sites use this function is in a store etc. You choose your product-types, if you for example chose a larger size, the price becomes higher and then it updates in real time. So what I mean is like, the number increases/decreases depending on the users selections, if he wants that or not that included, the number changes so he/she can see the exact price he needs to pay for the product. Like this for standard ---------------- 25$ --------------- but if I for example choose a larger size it automatically updates to ------------- 30$ ------------ I hope u understand what I mean. Thanks in advanced
  24. I had a doubt regarding the facebook-link-previewer (http://lab.leocardz.com/facebook-link-preview-php--jquery/).Can you please tell me where the control goes once we hit the post button? What should i do if i have another variable i want to pass when the post button is hit. I dont see any $_POST or $_GET. Can someone please help me.
  25. I'm trying to learn jquery and ajax and not doing so well I am trying to pass the id from this dropdown when it is selected to the next ajax script and it is not working. Both scripts pull there data from the same table so if there is a way to do this with one script I would be interested. <select name="customer"id="customer" class="form-control input-sm responsetext" > </select> $( document ).ready(function() { $.ajax({ //create an ajax request to load_page.php type: "GET", url: "customer.php", dataType: "html", //expect html to be returned success: function(response){ $(".responsetext").html(response); //alert(response); } }); }); <?php include("connect.php"); $id = $_SESSION['profile']['id']; echo "<option value=''>SELECT A CUSTOMER</option>"; foreach($db->query("SELECT * FROM customers WHERE pid = '$id'") as $row) { echo "<option value=" . $row['id'] . ">" .$row['name'] . "</option>"; } The above script creates the select box and it works. Now I need the $row['id'] To be picked up by the next script to fill in the input field. <input name="contact" class="form-control input-sm contactresults" id="contact"> $(function() { // document.ready $("#id").on("change", function() { $.ajax({ url: "contact.php", type: "GET", data: { id: $(this).val() }, success: function(data) { $(".contactresults").html(data); } }); }); }); <?php include("connect.php"); $id= $row['id']; echo "<option value=''>SELECT A CUSTOMER</option>"; foreach($db->query("SELECT * FROM customers WHERE id = '$id'") as $row) { echo $row{contact"}; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.