Of course, if the user enters their last name first there, it won't work. ;)
On Sun, May 31, 2009 at 4:36 PM, Charlie Griefer <[email protected]> wrote: > > On Sun, May 31, 2009 at 2:24 PM, Rick Jensen <[email protected]> wrote: > >> >> Summary: I am trying to autofill an input field based on the values of two >> other fields. >> >> Detail: I have two input fields called First_name and Last_name. I have a >> third field called Profile_name. I want to fill in the Profile_name to equal >> the value of the first two fields automatically when you lose focus on each >> of First_name and Last_name field. >> >> The new value of the Profile_name is a suggestion and the user may choose >> to overwrite it. If they go back and update the First_name and Last_name >> fields after the fact, I don't want to update the Profile_name field again. >> > > <input type="text" name="First_name" id="firstName" /> > <input type="text" name="Last_name" id="lastName" onblur="fillProfile();" /> > > <input type="text" name="Profile_name" id="profileName" /> > > <script> > function fillProfile() { > if (document.getElementById('profileName').value == "") { > document.getElementById('profileName').value = > document.getElementById('firstName').value + > document.getElementById('lastName').value; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323014 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

