For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > April 2006 > Re: [PHP-DB] Dynamic DataBinding in Form









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PHP-DB] Dynamic DataBinding in Form
Micah Stevens

2006-04-30, 6:58 pm

Not quite sure what you're asking, but I think you mean, you want to
automatically fill customer with the concat'd values of FName and LName..

You can do this with PHP, but only once the form is submitted (remember,
PHP is server side) if you want to do it in the browser in front of the
user, you'll need some Javascript.. which is a bit off topic for this list.

The general idea though would be to set an onChange handler for the
FName and LName fields, and when it's triggered just update the other value:

document.getElementById('CUSTOMER').value =
document.getElementById('FName').value + ' ' +
document.getElementById('LName').value;

or something like that.

-Micah
JONATHAN GRAVOIS wrote:
> I have an INSERT form with several fields two of which are FName and LName.
> There is also a field named CUSTOMER which is the concatenation of those two
> fields separated by a space. Is there a way to fill in customer as the user
> types in the other two fields. I used to do this in Coldfusion; can I do it
> with PHP?
>
> Thanks,
> Jon
>
>



!DSPAM:4454ea70151712219219257!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com