I’m having trouble getting the ajaxfield.php sample code working that comes with the ajax implementation guide:
I took the unchanged file “ajaxfield.php” and placed the file within my secondary portal directory:
Here are the steps I followed:
In the Dashboard I went to Admin > Organize > Custom Fields
I selected “AJAX Selection Field” > Go to Step 2
For Field Name I typed “Test Ajax”
For AJAX data URL I typed http://nameofmywebsite.com/portal3/ajaxfield.php
Under options I selected the appropriate category: “IT - Portal Redesign (public)”
Then I clicked “Create Field”
I went into Customize > Secondary Portals.
I looked at the Edit Portal page for my portal. Normally a custom field will appear in the Custom Fields list so I can check it off and have it appear on my request form but since the “AJAX Selection Field” cannot be a public field it does not show up.
Anyway, I went to my Request page and there is no AJAX Selection Field. I typed “Tim” in the First Name input box hoping something will dynamically appear or change. Nothing happens.
I verified that the ajaxfield.php file is located at the URL that I inputted for AJAX data URL. When I go to that file directly it says:
"error on line 2 at column 1: Document is empty"
And if I look at the source it says:
Notice: Undefined index: sFirstName in /server-path-info/ajaxfield.php on line 9
Not sure if that matters.
Did I miss any steps to get the AJAX field to appear on the request page?
Does any extra code need to be added to my request.tpl.php template?
<ajaxfield>do I have to specifiy the custom field ID? I.e.
<ajaxfield name="Custom23" id="Custom23">?
Does the AJAX data URL need to be an absolute server path instead of a website URL?
Sorry about the density of this post, just want to make sure I give you all the info I can think of to help with troubleshooting.
Thanks for any help you can provide,