Real Estate Forums
| Coding HTML, ASP, PHP, JAVA MYSQL and more. All coding questions should be asked here. |
![]() |
|
|
Thread Tools | Display Modes |
|
||||
|
Hi Everyone,
I'm trying to get my form to automatically delete the default contents when the user clicks on that field. I'm can enter some scripting in the javascript onblur, but just don't know what to put in there to make this work. Basically, the form puts by default an example, and I've been getting form submits with the example text still in place. I'd like for that text to clear itself when the user clicks on that particular form field. Any help would be greatly appreciated! EDIT: Wait; is the onblur event after a user leaves the field or when they go into it?
__________________
Steve Castaneda, Realtor Keller Williams Realty The MyHomeHouston Team Specializing in Houston Real Estate. Feel free to visit my Houston Real Estate Blog or read about Real Estate Technology for agents. |
|
||||
|
I got it to work! I used this code:
if(this.value=='original_text') this.value=''; -- I replaced "original_text" with what the default values were, and now they clear if the user leaves that field alone without changing it.
__________________
Steve Castaneda, Realtor Keller Williams Realty The MyHomeHouston Team Specializing in Houston Real Estate. Feel free to visit my Houston Real Estate Blog or read about Real Estate Technology for agents. |
|
||||
|
Right; I failed to mention that the form component I'm using doesn't allow me to customize the onfocus; just onblur.
No clue as to why.
__________________
Steve Castaneda, Realtor Keller Williams Realty The MyHomeHouston Team Specializing in Houston Real Estate. Feel free to visit my Houston Real Estate Blog or read about Real Estate Technology for agents. |
|
||||
|
Off the top of my head, I'd say all form elements have onfocus events.
|
|
||||
|
I'm sure they do; it's just I'm using Joomla, and a Phil-A-Form component that allows back-end administration to create forms. Unfortunately, his software won't allow you to edit the onfocus.
__________________
Steve Castaneda, Realtor Keller Williams Realty The MyHomeHouston Team Specializing in Houston Real Estate. Feel free to visit my Houston Real Estate Blog or read about Real Estate Technology for agents. |
|
|||
|
Try the ChronoForm extension -- it's pretty flexible, and may allow you to do what you need.
|
|
||||
|
Quote:
__________________
Steve Castaneda, Realtor Keller Williams Realty The MyHomeHouston Team Specializing in Houston Real Estate. Feel free to visit my Houston Real Estate Blog or read about Real Estate Technology for agents. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|