Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old November 24th, 2004, 09:49 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Chris, I corrected what you told me to.... it almost work!.
The following scenario has strange result though... please, try it and tell me.
If it works for you in Netscape, then I will give up!!
- tabulator on field1 => cursor goes to field4 (ok)
- focus on field1 again and enter something
- tabulator on field1 => cursor goes to field2 (ok)
- enter something on field2 (or don't ... the result is the same!)
- tabulator on field2 => cursor goes to field1 !!!!!

Reply With Quote
  #12 (permalink)  
Old November 24th, 2004, 09:57 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hey Elisabeth,

Afraid it still works for me. Can you publish it somewhere on the net, check it doesn't work for you & then post the url so I can take a look?

Cheers,

Chris
Reply With Quote
  #13 (permalink)  
Old November 24th, 2004, 10:02 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That is strange!!!
Unfortunately, I can't publish it on the net... I would not know where!. I only have my intranet to test it and it does not work!.
Sorry you cannot take a look.
Well, I guess this is it then.
Thank you very much anyway for your time. I will try to do without it!



Reply With Quote
  #14 (permalink)  
Old November 24th, 2004, 10:34 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Elisabeth,

Very frustrating!!!

Another approach would be to check the value of the field each time a key is released, at least this way someone will not get confused when they try to focus on field 2 or 3 after clearing field 1 & in addition it might even work for you...
Code:
<html>

<head>
  <title></title>

<script type="text/javascript">
function initForm1(form)
{
    var f1 = form.field1.value;
    if (!f1.match(/^(\s)*$/) ) 
    {
        form.field2.disabled = form.field3.disabled = false;
    }
    else
    {
        form.field2.disabled = form.field3.disabled = true;
        form.field2.value = form.field3.value = "";
        setTimeout("document.forms." + form.name + ".field1.blur(); document.forms." + form.name + ".field1.focus();");
    }
    return true;
}
</script>

</head>

<body onload="initForm1(document.forms.myForm);">

<form name="myForm">
Field1:
<input type=text name="field1" tabindex=3  onkeyup="initForm1(this.form);"> 
<br>
Field2:
<input type=text name="field2" tabindex=4 disabled="disabled">
<br>
Field3:
<input type=text name="field3" tabindex=5 disabled="disabled">
<br>
Field4:
<input type=text name="field4" tabindex=6>
</form>

</body>

</html>
HTH,

Chris

Reply With Quote
  #15 (permalink)  
Old November 24th, 2004, 11:07 AM
Authorized User
 
Join Date: Feb 2004
Location: , , .
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It works!!!! You are the best!!!!
Thank you so much!!

Reply With Quote
Reply


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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
javaScript function in asp.net not work in firefox rsanuj ASP.NET 1.x and 2.0 Application Design 1 February 8th, 2007 11:37 AM
calling a codebehind function on onblur event vishnupriya.kamalakaram ASP.NET 1.0 and 1.1 Basics 2 July 7th, 2006 09:25 AM
How to call a codebehin function on onblur event?? kv Priya ASP.NET 1.0 and 1.1 Professional 1 June 14th, 2006 03:43 PM
can't seem to get the mail() function to work Graham76 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 October 5th, 2004 02:59 PM
function that doesn't work hosefo81 PHP How-To 1 March 10th, 2004 03:20 AM



All times are GMT -4. The time now is 01:41 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.