when user chooses a TITLE from title drop down this should update paxname with the chosen value and a space

when the user types a FIRST NAME into the first name textbox this should update the paxname with the value and a space

when the user types a LAST NAME into the last name textbox this should update the paxname with the value

therefore at the end of the process the paxname will have the full name of the person in order with spaces in between. also i would like the first name and last name values to be changed to proper case ie John Smith once placed into paxname

the update process does not have to be instantaneous, it can perhaps update the paxname textbox when the focus is gone from the field in question, dont mind how it works as long as it updates.

thanks, hopefully this is quite straightforward. also i would prefer a small bit of JS which i can add to the form element rather than a function if possible

This is quite straight forward, however you would have to deploy some functions to support cross browser event binding and with the number of events you want to listen I think it's simplified by deploying a library that does the work for you (I'm quite fond of jQuery).

The first function does your uppercase transformation, the second populates your 'paxname' field, and the 3rd uses a jQuery method for binding events to trigger the function to update the paxname field.

To write this in native javascript takes a fair bit longer and the only reason I would go down that path is if you need to learn how its done, or to save page bandwidth (or cpu cycles if this page is intended for mobile devices). I would also avoid writing inline javascript, either in html attributes like 'onclick="javascript: ... "' or inline <script> tags. It is more maintainable if your javascript is made as unobtrusive as possible.

Indeed. The other chap has shown you using jQuery, which shortens things quite a bit, at the expense of needing the large jQuery library attached.

Here's how it might be done without jQuery, and using just native JavaScript.

What do we need to know to begin with. The unique identifier for the form, the field elements of the form that we'll be monitoring, changes to the values (for initial casing), and info about what we'll be updating, and how.

one thing though. if the user enters the values in capital letters, the script does not convert the value to proper case, it stays as capital. can this be altered to change to proper case ie. John Smith regardless of whether the user enters john smith or JOHN SMITH

one thing though. if the user enters the values in capital letters, the script does not convert the value to proper case, it stays as capital. can this be altered to change to proper case ie. John Smith regardless of whether the user enters john smith or JOHN SMITH