Jump to content

mongoose0031800

Members
  • Posts

    22
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

mongoose0031800's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey All, I'm trying to make several date fields (dynamically populated) that all will have the jQuery datepicker on them. Then I want to use AJAX to get the value of a field after the user selects the date. Here is my code so far. <script type="text/javascript"> $(function(){ $("#date").datepicker({ onSelect: function(dateText, inst) { var date = dateText; $("#info").load("server.php?date="+date); } }); }); </script> </head> <body> <div id="info"></div> <input id="date"> I can get the date that the user picked for the field #date in the AJAX now. But if I add more date fields...date_1, date_2, date_3...I don't know how to tell jquery to use datepicker on those fields. When the date fields get dynamically populated the format would be "date_#DB_id". I also need a way to reference that id so I can update the item in the database. Did I explain this well enough?
  2. Also, this post should be in the "PHP Coding Help" sub-forum not the AJAX Help forum. I imagine it will be moved soon, just thought I'd mention it to you for future reference. Mongose
  3. I don't understand exactly what you are trying to do. Can you try to explain what you are attempting to accomplish with the above script more clearly and in more detail? Then I should be able to help you. Mongoose
  4. Ok problem solved. But here's the code that fixed it in case anyone else has the same issue. $(document).ready(function() { $("#show_list").sortable({ handle : '.handle', update : function () { var order = $('#show_list').sortable('serialize'); $("#info").load("scripts/process_show_order.php?"+order,function(){ location.reload(); }); } }); });
  5. Hello, I'm trying to add a line to my jQuery function that would make the page refresh after the AJAX was finished. This is my original script below that works fine. $(document).ready(function() { $("#show_list").sortable({ handle : '.handle', update : function () { var order = $('#show_list').sortable('serialize'); $("#info").load("scripts/process_show_order.php?"+order); } }); }); And this is my modified script that doesn't work. $(document).ready(function() { $("#show_list").sortable({ handle : '.handle', update : function () { var order = $('#show_list').sortable('serialize'); $("#info").load("scripts/process_show_order.php?"+order); }, location.reload(); }); }); I added the , after the function ended } and then on the next line I added location.reload();...which broke the script. Am I doing something wrong? Mongoose
  6. No luck still. This has to be a cache issue..
  7. I just had someone else tell me it works fine for him in FF 3.6...sounds like a cache issue. But I disabled cache and I still don't have it working in FF so I'm going try downgrading from FF 5.0 to FF 3.6 and see what happens although that shouldn't matter since it works in FF 5.0 locally. This is really strange..
  8. I'm sorry, I should have been more specific..I've just been pulling so much hair out of my head that I wasn't thinking. Here is a link - http://sharpenedconception.com/development/jumpin_jupiter/admin_show_order.php Login is disabled for development purposes. The drag and drop doesn't function when it is live. If it's local it does. It acts like the required files are not on the server or the code isn't coded properly but I've checked all of this and everything checks out fine. Also, maybe this will help, a while back I ran into a problem that really sticks out in my mind and I think was along the same lines of what is going on here. I had some javascript or jQuery that wasn't working. It was the same issue, it worked on my local machine but not when I put it live no matter where it was. Finally, after much hair pulling, I did something simple but I can't remember what it was. I think I changed some " or ' to the opposite ' or " in the <script> tags or did something else to the <script> tags. I don't know...I can't remember and I've been searching through old code to try and get a hint as to what it was but I've had no luck either. Maybe this will help. The link below seems like he had the same problem I had a while back and fixed it the same way but I don't fully understand what he did to fix it. http://stackoverflow.com/questions/3065904/jquery-draggable-not-working-in-chrome-safari Please let me know if any of this helps at all. **EDIT Now in the jQuery forum someone else said that the drag and drop at the link I provided works fine for him in Chrome. Can someone else test this in Chrome or any other browser besides IE? I just tested it again in Chrome (cleared cache), FF, Safari and it still doesn't work for me.
  9. Firebug did give me errors. The errors keep referring to this line. $(document).ready(function() { Any idea? Or is there anything I can provide to help narrow this down?
  10. Yes I've checked firebug and it appears it is throwing no errors. Like I said, it works in FF as long as it is local on my computer...only when I put it live does it quit working. All the required files are on the server and are accessible. Nothing makes any sense. I've also made a post in the jQuery forum but haven't gotten any response. Mongoose
  11. That is one of the first things I did. That's a pretty normal step in the beginning of my debugging process and should be of any experienced developer in my opinion, but thanks for the help! Mongoose
  12. I get no error at all. The only symptom is that in IE I can drag and drop the items, FF, Chrome, Safari I cannot. But if I'm my local on my computer the drag and drop works in all browsers.
  13. Hey All, The following code works on all browsers when I'm testing locally on my computer. When I put it live though on my server, it works in IE, but not FF, Chrome, or Safari. I'm not sure what the issue is. The code uses Jquerys sortable function and AJAX with PHP to make a drag and drop script which allows the user to organize the items easily. Like I said, I'm not sure what the issue is...can anyone help? Is it my PHP, my Jquery at the top, something else? I know it's probably something small and stupid. Also, I know there is a possibility this might not be a PHP problem but I don't know if thats the case for sure and I put it in this thread because no one looks at the JS or other threads too often and it just might be a PHP issue. Please don't move the thread for my sake so there is a chance I might get some help. Thanks so much! PHPFreaks rocks! Mongoose <?php //disable magic quotes require_once('includes/disable_magic_quotes.inc.php'); ?> <!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=UTF-8"> <title>Change Show Order</title> <link rel="stylesheet" type="text/css" href="styles/view.css" media="all"> <link rel="stylesheet" type="text/css" href="styles/ui-lightness/jquery-ui-1.8.15.custom.css" media="all"> <script type="text/javascript" src="javascript/view.js"></script> <script type="text/javascript" src="javascript/calendar.js"></script> <script type="text/javascript" src="javascript/jquery-1.6.2.min.js"></script> <script type="text/javascript" src="javascript/jquery-ui-1.8.15.custom.min.js"></script> <style> ul#show_list { list-style:none; margin:0; padding:0; } ul#show_list li { float:left; width:153px; padding:1px; margin: 3px 3px 3px 0; } .ui-state-highlight { height: 206px; } #info { display: block; padding: 10px; margin: 0px; border: 1px solid #333; background-color: #efefef; } /* li.show_listing_container { float:left; margin:5px 0px 10px 0px; font-family:Arial, Helvetica, sans-serif; width:169px; padding:0; } li.show_listing_container a{ width:169px; } */ </style> <script type="text/javascript"> $(document).ready(function() { $("#show_list").sortable({ handle : ".handle", update : function () { var order = $("#show_list").sortable("serialize"); $("#info").load("scripts/process_show_order.php?"+order); } }); }); </script> </head> <body id="main_body" > <img id="top" src="images/top.png" alt=""> <div id="form_container" style="width:716px"> <h1><a>Add Show</a></h1> <form id="form_200831" class="appnitro" enctype="multipart/form-data" method="post" action=""> <div class="form_description"> <h2>Change Show Order</h2> <p>Use the form below to drag and drop the shows into the order you would like them to be displayed in.</p> <?php require_once('includes/admin_nav.inc.php'); ?> </div> <pre style="margin:0; padding:0;"> <div id="info">Drag shows to update show order.</div> </pre> <ul id="show_list"> <?php require_once('scripts/dbconfig.php'); $get_shows = mysql_query("SELECT * FROM shows WHERE front_page_featured = '1' ORDER BY position ASC"); while($row = mysql_fetch_array($get_shows)) { ?> <li id="listItem_<?php echo $row['id']; ?>"> <div class="show_listing_image"><img src="images/show_images/small/<?php echo $row['picture_1']; ?>" border="0" width="153px" class="handle"></div> <div class="show_listing_title"><?php echo $row['title']; ?></div> <div class="show_listing_date"><?php echo date("l, F jS", strtotime($row['date'])); ?></div> </li> <?php } ?> </ul> </form> <div id="footer"> </div> </div> <img id="bottom" src="images/bottom.png" alt=""> </body> </html>
  14. Hey all, Why isn't my script outputting any value when I use the following code? $item_count = count($_POST['qty']); die($item_count-1); I've already tested that $_POST['qty'] isn't empty. If I output count($_POST['qty']) then it displays a value. But if I try to subtract a value of 1, no value comes out. I swear I've seen people add/subtract values from a count function...am I wrong about this? Thanks! mongoose
×
×
  • 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.