Results 1 to 9 of 9

Thread: [RESOLVED] JavaScript Array to PHP post

Threaded View

  1. #1

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Resolved [RESOLVED] JavaScript Array to PHP post

    I have this java array:
    Code:
        j_cdb = Array({"cid":"43","pid":"2","name":"ATV","srch":"ATV"},{"cid":"44","pid":"8","name":"AU Jobs","srch":"AU Jobs"},{"cid":"20","pid":"1","name":"Accommodation","srch":"Accommodation"},{"cid":"21","pid":"1","name":"Accounting","srch":"Accounting"},{"cid":"22","pid":"8","name":"Accounting & Finance Jobs","srch":"Accounting & Finance Jobs"},{"cid":"23","pid":"1","name":"Advertising & Design","srch":"Advertising & Design"},{"cid":"24","pid":"1","name":"Advertising & Marketing","srch":"Advertising & Marketing"}, etc...)
    
    document.getElementById("theA").value=j_cdb; //this isn't working
    I want to post it and process it in PHP. I have a hidden field (theA) and the submit button. When this code executes:
    PHP Code:
    if (isset($_POST['theA'])) {
        
    var_dump($_POST['theA']);

    I get:
    Code:
    string(8719) "[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object], etc....
    I have tried json.stringfy / json decode. I am very new at this (java / php) so any guidance would be appreciated.
    Last edited by dbasnett; Oct 13th, 2012 at 10:09 AM.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

Posting Permissions

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



Click Here to Expand Forum to Full Width