PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WEBDEV 2024 → How do I replicate this HTML code in WebDev?
How do I replicate this HTML code in WebDev?
Iniciado por Steve Thompson, 04,nov. 2014 10:31 - 7 respuestas
Publicado el 04,noviembre 2014 - 10:31
Hi,

How do I replicate this HTML code in WebDev? It's the oncliick / onfocus bit I'm struggling with.



<input type="text" value="Test1" onclick="this.select()" />


<input type="text" value="Test2" onfocus="this.select()" />


Thanks, Steve
Publicado el 13,noviembre 2014 - 12:46
Anyone???

Surely I can't be that difficult!
Publicado el 13,noviembre 2014 - 17:51
Hi Steve

not a lot of html developers here... So if you were instead to tell us
what you want to achieve in English, you may have more answers

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

NEW: WXReplication, your open source replication system is available on
my web site!!!
WXShowroom.com: Show your projects!
More information on http://www.fabriceharari.com


On 11/13/2014 6:46 AM, Steve Thompson wrote:
Anyone???

Surely I can't be that difficult!
Publicado el 14,noviembre 2014 - 10:15
Ok, sorry Fabrice,

When I click in a text field I'd like the current contents of the text field to be highlighted automatically so that any text input overwrites the current content.

Regards, Steve
Publicado el 27,noviembre 2014 - 10:31
Still no one knows?
Publicado el 16,diciembre 2014 - 21:20
Hi Steve,
Sorry for the late response,

Assuming you already have created the Edit control(textbox) with some prepopulated value.
I used a Page Level Javascript Browser Function, this function is simply:
FUNCTION selectField(id) {
var control = document.getElementById(id);
control.select();
}


In the WLanguage Click (onclick) put
selectField(MySelf..Alias)

Myself..Alias passes the html id to the javascript function.
FYI, WebDev alreayd does this natively when tabbing between controls. Put this code in the onclick function if you want to add the functionality when the user selects a field using their mouse.
Publicado el 17,diciembre 2014 - 14:06
This solution was implemented in WebDev 18. It should work in WebDev 19 and actually hopefully just putting
this.select();

as javascript into the onclick code.
Publicado el 17,diciembre 2014 - 16:58
Thanks Zach,

The first suggestion worked - the second didn't seem to...

Regards, Steve