A mew way of presenting labels in fields

Questions and answers for designing and implementing forms in Servoy

A mew way of presenting labels in fields

Postby JonathonBevan1343569030 » Sun Jul 29, 2012 3:44 pm

Hi

I notice from the most attractive and clear website deignes that screen real estate is decreased by dropiing the label of a field. Instead, a field when blank has the label in a different colour in the field itself..

So instead of

----------------------------------------------------
Search Customer ( )
-----------------------------------------------------

You have

-----------------------------------------------------------
( Enter Customer Name To Search... )
-----------------------------------------------------------

Where the label is in the field (text box) until the user types something in...

I suppose Servoy doesn't provide such display options?

Appreciate any comments received..

Cheers
Jonathon
JonathonBevan1343569030
 
Posts: 1
Joined: Sun Jul 29, 2012 3:37 pm

Re: A mew way of presenting labels in fields

Postby omar » Sun Jul 29, 2012 11:29 pm

Hi Jonathon,

You could reproduce this behaviour by setting the text and changing the fontcolor to gray when the textfield is empty and then remove the text and change the color when the textfield gets the focus.

Kind regards,
Intrasoft, Founder
Omar van Galen
omar@intrasoft.nl
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 377
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands

Re: A mew way of presenting labels in fields

Postby david » Mon Jul 30, 2012 8:38 pm

HTML5 has a placeholder attribute. So for web client, when you create a new record you could do this to insert this attribute on various fields:

Code: Select all
var wicketID = plugins.WebClientUtils.getElementMarkupId(elements.fld_company_name)   
   var js = "$('#" + wicketID + "').attr('placeholder', 'Enter company name...')"   
   plugins.WebClientUtils.executeClientSideJS(js)


Screen shot 2012-07-30 at 2.37.58 PM.png
Screen shot 2012-07-30 at 2.37.58 PM.png (10.04 KiB) Viewed 2417 times


For smart client, we used to do this all the time: http://www.servoymagazine.com/home/2005/12/tip_multiline_l.html
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.


Return to Forms

Who is online

Users browsing this forum: No registered users and 8 guests

cron