PDA

View Full Version : OnFocus Clears Current Value in Input Box


markk
10-12-2009, 06:50 AM
Recently, we upgrade to 3.8.4PL1 and did some major restyling of the mesage board. One of the behavior that our users noted was that <input> fields on forms such as "edit thread" have the behavior where the current (default) value disappears when the cursor is focused on the field. This is problematic for users editing fields like title where the want to modify the title based on the previous title.

The question is how is retain the behavior such then when the cursor is focused on an <input> field that to starts the field for editing with the current "value=" attribute rather than blank.

Thanks,
Mark K.

Lynne
10-12-2009, 03:17 PM
Try this -
Create a new style with no parent:

Styles & Templates > Style Manager > Add New Style
Parent Style: No Parent Style
Title: Default vBulletin
Allow User Selection: Yes
Save

Then browse the site using that totally default vbulletin style - do you still have the same problem?

markk
10-12-2009, 03:46 PM
The default style does not exhibit this issue-- in other words, the default style has the input field with default value available for editing.

I have looked at the HTML generated for the problem styling, and I don't see any javascript for onfocus or the like. I would appreciate any suggestions on debugging the issue.

Thanks, Mark K.

Lynne
10-12-2009, 03:55 PM
I would take a look at the page, find the templates on the page, then edit that template and select View History > Compare and see what the differences are between your style and the default Jelsoft style and then modify your style accordingly.

pein87
10-19-2009, 08:52 PM
add this to your input box

value="username" onfocus="if(this.value=='username')this.value=' ';" onblur="if(this.value==' ')this.value='username';"
it changes the input text dynamicly if you click inside it the value is blank if you click away and the input is blank it goes back to username. also in your css add the :focus psuedo-class so it works in all IE versions.