Auto Fill Fields

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
JoeB7774
User
Posts: 76

Auto Fill Fields

Post by JoeB7774 »

Hello,

I'm stuck on the Auto-Fill functionality. What I would like to do is have a user select a job number from a list. I would then like auto-fill to fill in the Customer Name, Address, etc. The customer, name, address, etc. data doesn't need to be a field (per-say) as I just need to be able to display the data to the user. Would it be better to run a small script on the page load instead? My php experience is limited so any direction would be greatly appreciated.

Thanks,

Joe


arbei
User
Posts: 9424

Post by arbei »

JoeB7774 wrote:
The customer, name, address, etc. data doesn't need to be a field (per-say) as I just need to be able to display the data to the user.

If they are not fields, you don't have the target fields to fill. Then you better use Ajax to to get the data and display it in a DIV, see the example in the topic Lookup table > Ajax by API and Client Scripts in help file.


JoeB7774
User
Posts: 76

Post by JoeB7774 »

Thanks for the reply. I've looked at the help file and the online demo. The online demo main page has a good example on the landing page on a div/card setup. When referencing a field on the current form, would I reference it as follows (if my field in the PHPMaker form is named projectNumber)? DO I need the '&' (as with VBA) or how do I reference the field?

	" WHERE " .
	"`projects`.`projnum` <=" & $this-><projectNumber>-><value> ";

Thanks,

Joe


arbei
User
Posts: 9424

Post by arbei »

You may learn PHP syntax here:

Strings (and Variable Parsing): https://www.php.net/manual/en/language.types.string.php
String Operators: https://www.php.net/manual/en/language. ... string.php


JoeB7774
User
Posts: 76

Post by JoeB7774 »

That worked perfect. Thanks for the help. I am also experimenting with the autofill functionality just to see what it can do but I seem to be running into a problem. I've setup a single table that has 'JobType', 'JobNumber', 'CustomerName', and 'CustomerAddress'. I know its not normalized but I just wanted to test out the Autofill. My first combo box is to select the 'JobType'. The user selects the job type and then the 'JobNumber' combo box below is filled with all of the job numbers for that particular job type. This works fine. My problem lies when I try to use the 'JobNumber' combo to autofill CustomerName and CustomerAddress. As soon as I enable autofill, every time I try and enter a 'Job Type' in the first combo box, the value of the combo box immediately switches from the type I selected back to 'Please Select'. The 'JobNumber' field doesn't get populated with any values at all. Is there something with the autofill that I'm missing?

Thanks again for all the help.


Post Reply