Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > Programming > Javascript and Ajax
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

Javascript and Ajax Questions and information about working with Ajax and Javascript in Delphi for PHP.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 16th April 2009, 21:34
D4PHP User
 
Join Date: Apr 2009
Posts: 10
Dennis445 is on a distinguished road
Default Auto select text in an edit field

Heres what I have for code the rest works except fot the first line and I'm not sure what I am missing?


function emailJSFocus($sender, $params)
{

?>
document.Vendor('email').select();
findObj('email').style.backgroundColor= '#fdfbd9';

<?php

}

function emailJSBlur($sender, $params)
{

?>
if (document.getElementById("email").value == "") {
findObj('email').style.backgroundColor= '#ffcaca';
document.getElementById("email").value = "Required!"
}
if (document.getElementById("email").value.indexOf ('@', 0) == -1) {
findObj('email').style.backgroundColor= '#ffcaca';
document.getElementById("email").value = "Not valid!"
}
else {
findObj('email').style.backgroundColor= '#d0ffca';
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 16th April 2009, 23:42
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,216
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

findObj('email').select();

BTW findObj (and vcl.$) is just a helper function that calls document.getElementById (among other things vcl specific)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 16th April 2009, 23:54
D4PHP User
 
Join Date: Apr 2009
Posts: 10
Dennis445 is on a distinguished road
Default

Does this work with and edit field on a pagecontrol? I tried this earlier without any luck.

Also something else I noticed when you double click an edit box it wont highlite the text either. I think I read somewhere today that you have to use text box's instead of edit box's with pagecontrols is that correct?

Last edited by Dennis445; 16th April 2009 at 23:59.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 17th April 2009, 00:22
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,216
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

Pagecontrol doesn't play well with others

Edits have a lot of problems when qooxdoo (qx) components are on a page so you tend to need textfield and labeledit which are qx also.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 17th April 2009, 00:24
D4PHP User
 
Join Date: Apr 2009
Posts: 10
Dennis445 is on a distinguished road
Default

Ok answered my own question the edit field has issues on a pagecontrol.

I did notice one other thing both controls on an empty canvas will accept the select command but behave different.

Edit field will select all text when clicked with the mouse and when tabbed.

Text field will only select all text when tabbed not when clicked with the mouse.

405hp - thanks for the answer, my head hurts.

Last edited by Dennis445; 17th April 2009 at 00:27.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 12:08.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use