1 Replies - 482 Views - Last Post: 05 October 2013 - 12:31 AM

#1 theNoob  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 66
  • Joined: 14-July 12

javascript button listener

Posted 03 October 2013 - 06:12 AM

how do i use the button below to pass the information?

<input value="Products" onclick="productSearch({{=Author.id}})" type="button">



i want ({{=Author.id}}) to be passed on to the script below..

<script type = "text/javascript">
    function productSearch(choice){
        $('#results').load("http://127.0.0.1:8000/suzannecollins/default/authorproducts.html", {"input": choice} function{});
</script>



basically i want the Products button to obtain the Author.id for each author in the table, pass it to the script below which loads all the products who have the same Author.id and displays it on authroproducts.html

This post has been edited by theNoob: 04 October 2013 - 04:23 AM


Is This A Good Question/Topic? 0
  • +

Replies To: javascript button listener

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3479
  • View blog
  • Posts: 10,025
  • Joined: 08-June 10

Re: javascript button listener

Posted 05 October 2013 - 12:31 AM

Quote

how do i use the button below to pass the information?

not at all.


Quote

basically i want the Products button to obtain the Author.id for each author in the table, pass it to the script below which loads all the products who have the same Author.id

this is nothing a button itself can do. you need a JS script to fetch all autor IDs from the (HTML) table. if we’re talking of a DB table. then JS is not even involved (beyond triggering and receiving the request).
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1