![]() |
| Domain Name Sales | Domain Software | Calculate UK Domain Drop Dates | Domain Registration | NameDrive | Domain Parking | Subscribe to our Domains For Sale newsletter |
| | ||||||
| Home | Register | Rules | Membership Upgrade | Domains For Sale | Domain Name Escrow | Mark Forums Read | Domain Classified | Chat Room |
| Scripts and Coding PHP, MySQL, scripts |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 (permalink) |
![]() | help, text area on forms
I'm using the following to set up the input fields in my form: <input class="form2" onfocus="this.select()" onblur="this.value=!this.value?'Mobile' his.value ;" onclick="this.value='';"/ type="text" name="mobile" size="24" style="color:#888;" value="Mobile" /> This displays what to enter in the field (eg. name, mobile), which then disappears on click and comes back if nothing is entered and the user clicks outside of the box. The 'value=""' attribute is needed otherwise no text appears in the input fields from page load, only once a user has clicked in and out of the field. I have a text area at the bottom of my form which I want to behave in the same manner. I can get it to display the default text I want when the user has clicked in and out of the box, but not from page load. I've added the value attribute but it doesn't make any difference.. Can anyone help? The code I'm using for the text area is as follows: <textarea class="form2" onfocus="this.select()" onblur="this.value=!this.value?'Description (50 words max)' his.value;" onclick="this.value='';"/ rows="9" style="color:#888" name="message" cols="30" value="Description (50 words max)"></textarea>
|
| |
| | #3 (permalink) |
![]() |
Its because textarea works differently - The contents are originally declared by whats inbetween <textarea> and </textarea> Code: <textarea class="form2" onfocus="this.select()" onblur="this.value='Description (50 words max)'" onclick="this.value=''"/ rows="9" cols="30" value="">Description (50 words max)</textarea> Code: <textarea class="form2" onfocus="this.value=''" onblur="if(this.value=='')this.value='Description (50 words max)';" rows="9" cols="30" value="">Description (50 words max)</textarea> Last edited by Ashton; 27-02-2011 at 04:50:58 PM. |
| |
| | #5 (permalink) |
![]() |
No worries |
| |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Domain Name Community | Replies | Last Post |
| My free online web forms builder | immediate | Website Reviews | 0 | 24-05-2010 10:19:22 AM |
| missing text problem | Reg Wharf | Scripts and Coding | 2 | 17-03-2010 11:15:44 PM |
| White text on homepage | Frenchiexno1 | Search Engine Optimisation | 10 | 10-04-2009 07:26:13 PM |
| Update MySQL from a text file | admin | Scripts and Coding | 10 | 15-06-2008 10:09:21 PM |