Results 1 to 2 of 2

Thread: Ajax responseText parsing ?

  1. #1
    Join Date
    Sep 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Ajax responseText parsing ?

    Hi All !

    I am using PHP & My SQL for my testing rig. I have an HTML form having few fields on it like customer ID, phone no, postal address , email adress, date of purchase etc.

    based on value of customer id , i am able to get his phone no from my SQL database & I am able to succefully retrieve it from the database using Ajax i.e. without refreshing the whole page.

    I am able to fill one field i.e. phone no. , using ajax , but i want to fill rest of the form fields also which depends on custid like email adress & postal adress.

    I can add email, cust_add, cust_email in my SELECT query along with the phone field but what do I do in when I receive responseText.

    I mean how do i populate rest of the fields with the responseText I have received ? How do i place adress in form's address field & e-mail in email addres filed ?

    Please guide.

    Regards,

    tralsi

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    As far as I know there is no standard method, it would depend upon how the responseText actually looks. If it has any obvious delimiters between the various data bits, and if the pattern of the responseText in these instances (as to which data bits come in what order) or if there is an easy way to tell which is which from their format, something can be worked out.

    What does the responseText look like when it contains all of the information that you are interested in importing to your form? Is it always in the same order? If their is missing information, how (if at all) is that represented?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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