Jump to content
Larry Ullman's Book Forums

Search the Community

Showing results for tags 'adaptation'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Single Editions
    • Modern Javascript: Develop and Design
    • The Yii Book
    • Effortless Flex 4 Development
    • Building a Web Site with Ajax: Visual QuickProject
    • Ruby: Visual QuickStart Guide
    • C++ Programming: Visual QuickStart Guide
    • C Programming: Visual QuickStart Guide
    • Adobe AIR: Visual QuickPro Guide
  • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (5th Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
    • PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide (3rd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (2nd Edition)
    • PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (1st Edition)
  • PHP for the Web: Visual QuickStart Guide
    • PHP for the Web: Visual QuickStart Guide (5th Edition)
    • PHP for the Web: Visual QuickStart Guide (4th Edition)
    • PHP for the Web: Visual QuickStart Guide (3rd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (2nd Edition)
    • PHP for the World Wide Web: Visual QuickStart Guide (1st Edition)
  • Effortless E-commerce with PHP and MySQL
    • Effortless E-Commerce with PHP and MySQL (2nd Edition)
    • Effortless E-Commerce with PHP and MySQL
  • PHP Advanced: Visual QuickPro Guide
    • PHP Advanced and Object-Oriented Programming: Visual QuickPro Guide (3rd Edition)
    • PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
    • PHP Advanced: Visual QuickPro Guide
  • MySQL: Visual QuickStart Guide
    • MySQL: Visual QuickStart Guide (2nd Edition)
    • MySQL: Visual QuickStart Guide (1st Edition)
  • Other
    • Announcements
    • Newsletter, Blog, and Other Topics
    • Forum Issues
    • Social

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 1 result

  1. Hi Larry my name is sam can i first start by saying i absolutely love your books. i am currently working on a project where i have built the php side of things and now working on enhancing using javascript. i am adapting your script from your Modern javascript develop and design book on chapter 15, (view.js). But the problem i have is my php script loops through the database to show results and i am trying to pass the id of the data, like you do in your view.php script to the view.js script with, <script> var itemId = ' . $itemid .'; </script> BUT i have a while loop on the php script and the script tags are in the while loop like this, $query = "SELECT `item_id` FROM items"; $results = mysqli_query ($dbc, $query); while (list ($item_id ) = mysqli_fetch_array($results, MYSQLI_NUM)) { // Start the while Loop here ... echo '<form action="" method="post" id="bidForm" class="bidForm"> <input class="button" type="submit" value="Like" title="Like"> <input type="hidden" name="item_id" id="item_id" class="video" value="' . $item_id . '"> </form>'; ?> <script> var itemId = "<?php echo $item_id; ?>"; </script> } // End of while Loop here .. then link to external js script <script src="js/ajaxBid.js"></script> Just so you know this is not exact just example above but it does the exact same thing. So the problem is where it Loops the var itemId gets more then one value so you don't get the value of the button clicked sent to the ajax script. How can i get the id of the button clicked in my js script while still in the while loop???? sorry if this is really confusing i will answer any questions you might have. if you or anyone could explain in the simplest possible way where I'm going wrong as not brilliant at javascript yet, that would be amazing been stuck for ages on this. many thanks, Sam
×
×
  • Create New...