Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    passing values from client side java script to server side python script.

    Hi,
    I am new to coding.. I am developing a web form using python cgi which has two list boxes. On selecting a value from the listbox1, the list box 2 should get auto populated with appropriate values (which are taken from the DB). I have written a javascript function to get the selected value from the list box1. But I am struck with passing the values from the javascript to the python function written in server side in which I have written the DB related stuffs. Any help in this regard will be highly appreciated.

  • #2
    Regular Coder
    Join Date
    Feb 2009
    Location
    Wheeling, IL
    Posts
    358
    Thanks
    5
    Thanked 62 Times in 60 Posts
    The answer is rather simple... AJAX, AJAX and then some more AJAX. A comprehensive tutorial can be found at the following location:

    http://www.w3schools.com/Ajax/ajax_intro.asp

    Though if you're using a JS library, most of them have their own AJAX object that is even easier to use... in which case I'd direct you to the library's API.
    The way to success is to assume that there are no impossible things. After all, if you think something is impossible, you will not even try to do it.

    How to ask smart questions?

  • #3
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The w3schools tutorials go through using ASP and PHP on the server side. Anyone know of how python actually deciphers the information sent?

    Better yet, an example?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •