Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2005
    Thanked 0 Times in 0 Posts

    how to get value without submitting a page


    I have a form that has many fields (textbox/listbox). when user enter/change a value in the first textbox, I need to pass this value to the database to check whether it exist and get the other values to be displayed to other fields in that form (i cannot get the javascript value to be pass to jsp without reload/refresh/submit. But, I need to get the user entered value, so I thought of hidden popup, iframe, ajax, etc but not sure how I could apply and which best suit this case). If I submit the page then I can easily get the value thru 'request.getParameter("fieldname") but cannot use this because I cannot submit the page.

    Pls help and possible provide me with the sample coding


  2. AdSlot6
  3. #2
    New Coder
    Join Date
    Oct 2005
    Melbourne, Australia
    Thanked 0 Times in 0 Posts
    What you are looking for is called AJAX (Asynchronous Javascript and XML). Implementing it yourself is not fun (works differently in most major browsers), but luckily there are plenty of good libraries out there.

    The one I use is called Prototype. While it doesn't come with any documentation, I did find a good page with code examples here.

    You can get Prototype here.

    edit:scroll down to the bit with 'The Ajax object' as the heading.
    Last edited by EvilPenguin; 10-17-2005 at 05:11 AM.


Posting Permissions

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