Sign in

E-mail *, (xx@domain.com)
Password *

Register | Forgot password

Active forums

Active Forums RSS September 03, 19:59
Style properties

August 31, 21:46
antrun not found

August 31, 14:12
WCB customprofile

August 31, 12:10
End of flow not doing its job

August 24, 12:37
Sort mediaItem by expiration date

 All Forums...


add "onfocus" to an input coming out of a form

The "WCB: JSP front-end design" forum contains threads on issues that are related to JSP front-end design while programming a WCB (WebManager Component Bundle). The Presentation & Element component contain JSPs that will be used for front-end rendering. Ask your questions related to these JSPs here. Some example topics: integration of AJAX, use of the taglibs, how to handle multiple websites, and so forth.

Answered
Not marked as answered yet

Forums  >  WCB: JSP Front-end design  >  add "onfocus" to an input coming out of a form


Author add "onfocus" to an input coming out of a form
pgoultiaev



Posts: 17

Posted: 16-01-2009 15:57

I am trying to add an "onfocus" attribute to an input coming out of a form which I have made using the forms module of WebManager.

In the standard formPart.jspf you need to use the following variable

 ${formPart.content}



to call the content of the form model (coming out of the forms module) which generates the HTML for eg. an input. The problem is that I cannot influence the HTML which is generated.

 <input class="normalclass" type="text" value="Uw gebruikersnaam" maxlength="250" style="" name="f79461" size="20"/> 



To make a long story short; I want to achieve something like the following:

 <input class="normalclass" type="text" value="Uw gebruikersnaam" maxlength="250" style="" name="f79461" size="20" onfocus="this.value=''" /> 


Taco



Posts: 79

Posted: 16-01-2009 16:03 Solved

What you can do is not use the formPart.content but write the content yourself. An example (for a text input):


<c:choose>
<c:when test="${wmfn:instanceOf(formPart, 'nl.gx.webmanager.cms.form.FormPartText')}">
<input type="text" maxlength="${formPart.maxLength}" name="${formPart.identifier}" value="${formPart.prefilling}" class="${formPart.styleOptions}" />
</c:when>
<c:otherwise>etcetc</c:otherwise>
</c:choose>



You can (ab)use any available fields in forms module you don't need (help text, additional text) for adding attributes the forms module doesn't provide.

pgoultiaev



Posts: 17

Posted: 16-01-2009 16:23

Thanks for the fast (and helpful) reply!

Back to top

New message: "add "onfocus" to an input coming out of a form"
Message:
bold boitalicd underline url quote code smile cool eek grin mad razz sad wink
 
© 2010 GX creative online development B.V.

Disclaimer

This website (GXdeveloperweb.com) may discuss or contain opinions, (sample) coding, software or other information that does not include GX official interfaces, instructions or guidelines and therefore is not supported by GX. Changes made based on this information are not supported.  GX will not be held liable for any damages caused by using or misusing the information, software, instructions, code or methods suggested on this website, and anyone using these methods does so at his/her own risk. GX offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this website, including any liability resulting from incompatibility between the content of this website and the materials and services offered by GX. By using this website you will not hold, or seek to hold, GX responsible or liable with respect to the content of this website.