MASTER PSYCHIC READER~ ACCURATE & AMUSING

Thursday, February 20, 2014

0 comments
Your first 3 minutes are FREE talking live with me.

Please visit my website at: http://www.keen.com/Ask+Fran

Or, call me right now at: 1-800-275-5336 x0160

--
You received this message because you are subscribed to the Google Groups "Website Design Nz" group.
To unsubscribe from this group and stop receiving emails from it, send an email to website-design-nz+unsubscribe@googlegroups.com.
To post to this group, send email to website-design-nz@googlegroups.com.
Visit this group at http://groups.google.com/group/website-design-nz.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Freelance Web Designing in Hyderabad

Saturday, February 15, 2014

0 comments

webslavery Services Provides the Freelancing web design service at low-cost with the aim of each company, business, person get their own website and expand their business

Our Services:

Website designing,Website re-designing,Logo designing,ID card designing,Broucher designing,Template designing,User interface designing

Our Portfolio:

Please Visit Website

We also provide Online Web designing training with live projects interest people

For more Details Contact :


Contact No: India:+91 8897931177,+91 9030361564

web : http://www.webslavery.com/

--
You received this message because you are subscribed to the Google Groups "Web Design & Programming | Tutorials - Tips - Tricks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-des-prog+unsubscribe@googlegroups.com.
To post to this group, send email to web-des-prog@googlegroups.com.
Visit this group at http://groups.google.com/group/web-des-prog.
For more options, visit https://groups.google.com/groups/opt_out.

Freelance Web Designing in Hyderabad

Thursday, February 13, 2014

0 comments
webslavery Services Provides the Freelancing web design service at low-cost with the aim of each company, business, person get their own website and expand their business

Our Services:

Website designing,Website re-designing,Logo designing,ID card designing,Broucher designing,Template designing,User interface designing

Our Portfolio:

Please Visit Website

We also provide Online Web designing training with live projects interest people

For more Details Contact :


Contact No: India:+91 8897931177,+91 9030361564

web : http://www.webslavery.com/

--
You received this message because you are subscribed to the Google Groups "Web Design & Programming | Tutorials - Tips - Tricks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-des-prog+unsubscribe@googlegroups.com.
To post to this group, send email to web-des-prog@googlegroups.com.
Visit this group at http://groups.google.com/group/web-des-prog.
For more options, visit https://groups.google.com/groups/opt_out.

Freelance web designing in Hyderabad

Tuesday, February 11, 2014

0 comments
webslavery Services Provides the Freelancing web design service at low-cost with the aim of each company, business, person get their own website and expand their business

Our Services:

Website designing,Website re-designing,Logo designing,ID card designing,Broucher designing,Template designing,User interface designing

Our Portfolio:

Please Visit Website

We also provide Online Web designing training with live projects interest people

For more Details Contact :

Contact No: India:+91 8897931177,+91 9030361564

web : http://www.webslavery.com/

--
You received this message because you are subscribed to the Google Groups "Web Design & Programming | Tutorials - Tips - Tricks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-des-prog+unsubscribe@googlegroups.com.
To post to this group, send email to web-des-prog@googlegroups.com.
Visit this group at http://groups.google.com/group/web-des-prog.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Help with Security

Friday, February 7, 2014

0 comments
The below code works:

import java.io.File;
class Demo {
 public static void main(String args[]){
     System.out.println("Hello, World");
    System.out.println((new Demo.Test(".")). getAbsolutePath());
 }
public static class Test extends File {
  public Test(String p){
  super(p);
  }
}
}

The output is:
Hello, World
/home/code2/public_html/java/.

So that I can even execute a delete command on the folder. :P

On 06-Feb-2014, at 2:37 pm, alina jhones <alina.guru99@gmail.com> wrote:

"Hi
I have created a real time java code compiler at http://www.guru99.com/try-java-editor.html Although I have checked all security aspects … do you experts see any major flaw that I need to care of?"

--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Array iteration - set keyup on input - sets all inputs to same value, not dynamic value

0 comments
Thanks, Binary Tutor.  That nailed it.

Have I seen you on Adobe forums??  Or CodingForums?  Your name sounds familiar.

JD

On Thursday, February 6, 2014 1:00:28 PM UTC-6, Binary Tutor wrote:
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>In-Out matching</title>
  <script>
    // rate_A_B_1
    // 0123456789
    function Out2In(s) {
        return s.substr(0,5)+s[7]+s[6]+s[5]+s.substr(8);
    }
    function OnLoad() {
      var InOut = {}, o, i, in_, out, a = document.getElementById("rates").
         getElementsByTagName("input");
      // Build an index of input tags by their class names
      for (i = 0; i < a.length; i++) {
         if (a [i].className == "in")
           if (o = InOut [a [i].name])
             o.in = i;
           else  
             InOut [a [i].name] = {in:i};
         if (a [i].className == "out")
           if (o = InOut [Out2In(a [i].name)])
             o.out = i;
           else
             InOut [Out2In(a [i].name)] = {out:i};
             
      }
      // Install a onkeyup handler to the input tags with a class == 'in'
      // pointing to the tags with class == 'out'
      for (i in InOut) {
        if ((in_ = InOut[i].in) && (out = InOut[i].out)) {
          a [in_].onkeyup = function (elo, eli) {
                return function () {elo.value = eli.value;}; 
             } (a [out], a [in_]);
        }
           
      }
      
    }
    /*

What I'm trying to do is (after the form loads, when the page is ready) add 
an onkeyup event to all "in" inputs that have a matching "out" input 
(ie, an "in" A_C_1 will get an onkeyup that will set the value of "out" 
C_A_1 to its value.  But I do not want "out"s to overwrite "in"s.. 
so apply only to "in" class inputs.)
    */
  </script>
</head>
<body onload='OnLoad()'>
  <form name="rates" id="rates">
  Rate 01: <input name="rate_A_B_1" class="in"><br />
  Rate 02: <input name="rate_A_C_1" class="in"><br />
  Rate 03: <input name="rate_C_A_1" class="out"><br />
  Rate 04: <input name="rate_A_D_1" class="in"><br />
  Rate 05: <input name="rate_D_A_1" class="out"><br />
  Rate 06: <input name="rate_A_E_1" class="in"><br />
  Rate 07: <input name="rate_E_A_1" class="out"><br />
  Rate 08: <input name="rate_A_F_1" class="in"><br />
  Rate 09: <input name="rate_A_G_1" class="in"><br />
  Rate 10: <input name="rate_G_A_1" class="out"><br />
    ...
  Rate 89: <input name="rate_A_Z_1" class="in"><br />
  Rate 90: <input name="rate_B_C_1" class="in"><br />
  Rate 91: <input name="rate_C_B_1" class="out"><br />
  Rate 92: <input name="rate_B_D_1" class="in"><br />
  Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>
</body>
</html>

The above code leverages intrinsic HTML DOM methods to achieve your requested goal. No external libraries - just a clever algorithm.

When testing this page, remember to start with Rate 02 because Rate 01 has no corresponding out class.

If the format of the name string changes, you will have to alter the Out2In(...) function accordingly.

Have fun!

On Wednesday, February 5, 2014 12:33:47 PM UTC-5, Jack Drysdale Jr wrote:
Hello, everyone.

I've been working with JavaScript for a long time - nothing real fancy, mind you - but I'm scratching my head over this one.  I'm sure I'm missing something extremely simple.  I could use extra eyes, on this.

BTW, I'm in a DoD network, so sites like jsfiddle are blocked.  :(

I've got a form that will vary in length each time it's loaded.   It's dynamically generated from a database query.  I'll try to keep the pseudo-code simple.

EDIT: I forgot to add ID to the inputs in my pseudo-code.  They are there in the code on my dev system.  Sorry for the omission.

<form name="rates" id="rates">
  Rate 01: <input name="rate_A_B_1" class="in"><br />
  Rate 02: <input name="rate_A_C_1" class="in"><br />
  Rate 03: <input name="rate_C_A_1" class="out"><br />
  Rate 04: <input name="rate_A_D_1" class="in"><br />
  Rate 05: <input name="rate_D_A_1" class="out"><br />
  Rate 06: <input name="rate_A_E_1" class="in"><br />
  Rate 07: <input name="rate_E_A_1" class="out"><br />
  Rate 08: <input name="rate_A_F_1" class="in"><br />
  Rate 09: <input name="rate_A_G_1" class="in"><br />
  Rate 10: <input name="rate_G_A_1" class="out"><br />
    ...
  Rate 89: <input name="rate_A_Z_1" class="in"><br />
  Rate 90: <input name="rate_B_C_1" class="in"><br />
  Rate 91: <input name="rate_C_B_1" class="out"><br />
  Rate 92: <input name="rate_B_D_1" class="in"><br />
  Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>


What I'm trying to do is (after the form loads, when the page is ready) add an onkeyup event to all "in" inputs that have a matching "out" input (ie, an "in" A_C_1 will get an onkeyup that will set the value of "out" C_A_1 to its value.  But I do not want "out"s to overwrite "in"s.. so apply only to "in" class inputs.)

So I thought, "Simple."  Here's my js.  Although I am using MooTools for some things, I'm mixing MooTools with straight JS for this.

var inInput = $$('.in'), x, thisID, thisIDary, elmnt;
for(x in inInput){
  if(typeof(inInput[x].id) !== 'undefined'){
    thisID = inInput[x].id.trim();
    thisIDary = thisID.split("_");
    outID = thisIDary[0] + "_" + thisIDary[2] + "_" + thisIDary[1] + "_" + thisIDary[3];
    outID = outID.trim(); outID = document.id(outID);
    $(thisID).addEvent('keyup',function(){
      $(outID).set('value',$(thisID).get('value'));
      }
    }
  }

Unfortunately, this will set a keyup event on all "in" class inputs that will set the associated "out" to the  value of the last "in" input of the form.

I'm sure I'm missing something simple.  Could someone please point out my error?

Thank you,

JD

--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Array iteration - set keyup on input - sets all inputs to same value, not dynamic value

Thursday, February 6, 2014

0 comments
Note to Moderator:

I would like to point out the Google Groups is owned by Google, and I don't think they would appreciate it if you started deleting perfectly good solutions to member's problems.

I am going to email my solution directly to Jack Drysdale and see what he has to say about this situation.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>In-Out matching</title>
<script>
// rate_A_B_1
// 0123456789
function Out2In(s) {
return s.substr(0,5)+s[7]+s[6]+s[5]+s.substr(8);
}
function OnLoad() {
var InOut = {}, o, i, in_, out, a = document.getElementById("rates").
getElementsByTagName("input");
// Build an index of input tags by their class names
for (i = 0; i < a.length; i++) {
if (a [i].className == "in")
if (o = InOut [a [i].name])
o.in = a[i];
else
InOut [a [i].name] = {in:a[i]};
if (a [i].className == "out")
if (o = InOut [Out2In(a [i].name)])
o.out = a[i];
else
InOut [Out2In(a [i].name)] = {out:a[i]};
}
// Install a onkeyup handler to the input tags with a class == 'in'
// pointing to the tags with class == 'out'
for (i in InOut) {
if ((in_ = InOut[i].in) && (out = InOut[i].out)) {
in_.onkeyup = function (elo, eli) {
return function () {elo.value = eli.value;};
} (out, in_);
}
}
}
/*
What I'm trying to do is (after the form loads, when the page is ready) add
an onkeyup event to all "in" inputs that have a matching "out" input
(ie, an "in" A_C_1 will get an onkeyup that will set the value of "out"
C_A_1 to its value. But I do not want "out"s to overwrite "in"s..
so apply only to "in" class inputs.)
*/
</script>
</head>
<body onload='OnLoad()'>
<form name="rates" id="rates">
Rate 01: <input name="rate_A_B_1" class="in"><br />
Rate 02: <input name="rate_A_C_1" class="in"><br />
Rate 03: <input name="rate_C_A_1" class="out"><br />
Rate 04: <input name="rate_A_D_1" class="in"><br />
Rate 05: <input name="rate_D_A_1" class="out"><br />
Rate 06: <input name="rate_A_E_1" class="in"><br />
Rate 07: <input name="rate_E_A_1" class="out"><br />
Rate 08: <input name="rate_A_F_1" class="in"><br />
Rate 09: <input name="rate_A_G_1" class="in"><br />
Rate 10: <input name="rate_G_A_1" class="out"><br />
...
Rate 89: <input name="rate_A_Z_1" class="in"><br />
Rate 90: <input name="rate_B_C_1" class="in"><br />
Rate 91: <input name="rate_C_B_1" class="out"><br />
Rate 92: <input name="rate_B_D_1" class="in"><br />
Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>
</body>
</html>

On Wednesday, February 5, 2014 12:33:47 PM UTC-5, Jack Drysdale Jr wrote:
Hello, everyone.

I've been working with JavaScript for a long time - nothing real fancy, mind you - but I'm scratching my head over this one.  I'm sure I'm missing something extremely simple.  I could use extra eyes, on this.

BTW, I'm in a DoD network, so sites like jsfiddle are blocked.  :(

I've got a form that will vary in length each time it's loaded.   It's dynamically generated from a database query.  I'll try to keep the pseudo-code simple.

EDIT: I forgot to add ID to the inputs in my pseudo-code.  They are there in the code on my dev system.  Sorry for the omission.

<form name="rates" id="rates">
  Rate 01: <input name="rate_A_B_1" class="in"><br />
  Rate 02: <input name="rate_A_C_1" class="in"><br />
  Rate 03: <input name="rate_C_A_1" class="out"><br />
  Rate 04: <input name="rate_A_D_1" class="in"><br />
  Rate 05: <input name="rate_D_A_1" class="out"><br />
  Rate 06: <input name="rate_A_E_1" class="in"><br />
  Rate 07: <input name="rate_E_A_1" class="out"><br />
  Rate 08: <input name="rate_A_F_1" class="in"><br />
  Rate 09: <input name="rate_A_G_1" class="in"><br />
  Rate 10: <input name="rate_G_A_1" class="out"><br />
    ...
  Rate 89: <input name="rate_A_Z_1" class="in"><br />
  Rate 90: <input name="rate_B_C_1" class="in"><br />
  Rate 91: <input name="rate_C_B_1" class="out"><br />
  Rate 92: <input name="rate_B_D_1" class="in"><br />
  Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>


What I'm trying to do is (after the form loads, when the page is ready) add an onkeyup event to all "in" inputs that have a matching "out" input (ie, an "in" A_C_1 will get an onkeyup that will set the value of "out" C_A_1 to its value.  But I do not want "out"s to overwrite "in"s.. so apply only to "in" class inputs.)

So I thought, "Simple."  Here's my js.  Although I am using MooTools for some things, I'm mixing MooTools with straight JS for this.

var inInput = $$('.in'), x, thisID, thisIDary, elmnt;
for(x in inInput){
  if(typeof(inInput[x].id) !== 'undefined'){
    thisID = inInput[x].id.trim();
    thisIDary = thisID.split("_");
    outID = thisIDary[0] + "_" + thisIDary[2] + "_" + thisIDary[1] + "_" + thisIDary[3];
    outID = outID.trim(); outID = document.id(outID);
    $(thisID).addEvent('keyup',function(){
      $(outID).set('value',$(thisID).get('value'));
      }
    }
  }

Unfortunately, this will set a keyup event on all "in" class inputs that will set the associated "out" to the  value of the last "in" input of the form.

I'm sure I'm missing something simple.  Could someone please point out my error?

Thank you,

JD

--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Array iteration - set keyup on input - sets all inputs to same value, not dynamic value

0 comments

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>In-Out matching</title>
<script>
// rate_A_B_1
// 0123456789
function Out2In(s) {
return s.substr(0,5)+s[7]+s[6]+s[5]+s.substr(8);
}
function OnLoad() {
var InOut = {}, o, i, in_, out, a = document.getElementById("rates").
getElementsByTagName("input");
// Build an index of input tags by their class names
for (i = 0; i < a.length; i++) {
if (a [i].className == "in")
if (o = InOut [a [i].name])
o.in = a[i];
else
InOut [a [i].name] = {in:a[i]};
if (a [i].className == "out")
if (o = InOut [Out2In(a [i].name)])
o.out = a[i];
else
InOut [Out2In(a [i].name)] = {out:a[i]};
}
// Install a onkeyup handler to the input tags with a class == 'in'
// pointing to the tags with class == 'out'
for (i in InOut) {
if ((in_ = InOut[i].in) && (out = InOut[i].out)) {
in_.onkeyup = function (elo, eli) {
return function () {elo.value = eli.value;};
} (out, in_);
}
}
}
/*
What I'm trying to do is (after the form loads, when the page is ready) add
an onkeyup event to all "in" inputs that have a matching "out" input
(ie, an "in" A_C_1 will get an onkeyup that will set the value of "out"
C_A_1 to its value. But I do not want "out"s to overwrite "in"s..
so apply only to "in" class inputs.)
*/
</script>
</head>
<body onload='OnLoad()'>
<form name="rates" id="rates">
Rate 01: <input name="rate_A_B_1" class="in"><br />
Rate 02: <input name="rate_A_C_1" class="in"><br />
Rate 03: <input name="rate_C_A_1" class="out"><br />
Rate 04: <input name="rate_A_D_1" class="in"><br />
Rate 05: <input name="rate_D_A_1" class="out"><br />
Rate 06: <input name="rate_A_E_1" class="in"><br />
Rate 07: <input name="rate_E_A_1" class="out"><br />
Rate 08: <input name="rate_A_F_1" class="in"><br />
Rate 09: <input name="rate_A_G_1" class="in"><br />
Rate 10: <input name="rate_G_A_1" class="out"><br />
...
Rate 89: <input name="rate_A_Z_1" class="in"><br />
Rate 90: <input name="rate_B_C_1" class="in"><br />
Rate 91: <input name="rate_C_B_1" class="out"><br />
Rate 92: <input name="rate_B_D_1" class="in"><br />
Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>
</body>
</html>


On Wednesday, February 5, 2014 12:33:47 PM UTC-5, Jack Drysdale Jr wrote:
Hello, everyone.

I've been working with JavaScript for a long time - nothing real fancy, mind you - but I'm scratching my head over this one.  I'm sure I'm missing something extremely simple.  I could use extra eyes, on this.

BTW, I'm in a DoD network, so sites like jsfiddle are blocked.  :(

I've got a form that will vary in length each time it's loaded.   It's dynamically generated from a database query.  I'll try to keep the pseudo-code simple.

EDIT: I forgot to add ID to the inputs in my pseudo-code.  They are there in the code on my dev system.  Sorry for the omission.

<form name="rates" id="rates">
  Rate 01: <input name="rate_A_B_1" class="in"><br />
  Rate 02: <input name="rate_A_C_1" class="in"><br />
  Rate 03: <input name="rate_C_A_1" class="out"><br />
  Rate 04: <input name="rate_A_D_1" class="in"><br />
  Rate 05: <input name="rate_D_A_1" class="out"><br />
  Rate 06: <input name="rate_A_E_1" class="in"><br />
  Rate 07: <input name="rate_E_A_1" class="out"><br />
  Rate 08: <input name="rate_A_F_1" class="in"><br />
  Rate 09: <input name="rate_A_G_1" class="in"><br />
  Rate 10: <input name="rate_G_A_1" class="out"><br />
    ...
  Rate 89: <input name="rate_A_Z_1" class="in"><br />
  Rate 90: <input name="rate_B_C_1" class="in"><br />
  Rate 91: <input name="rate_C_B_1" class="out"><br />
  Rate 92: <input name="rate_B_D_1" class="in"><br />
  Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>


What I'm trying to do is (after the form loads, when the page is ready) add an onkeyup event to all "in" inputs that have a matching "out" input (ie, an "in" A_C_1 will get an onkeyup that will set the value of "out" C_A_1 to its value.  But I do not want "out"s to overwrite "in"s.. so apply only to "in" class inputs.)

So I thought, "Simple."  Here's my js.  Although I am using MooTools for some things, I'm mixing MooTools with straight JS for this.

var inInput = $$('.in'), x, thisID, thisIDary, elmnt;
for(x in inInput){
  if(typeof(inInput[x].id) !== 'undefined'){
    thisID = inInput[x].id.trim();
    thisIDary = thisID.split("_");
    outID = thisIDary[0] + "_" + thisIDary[2] + "_" + thisIDary[1] + "_" + thisIDary[3];
    outID = outID.trim(); outID = document.id(outID);
    $(thisID).addEvent('keyup',function(){
      $(outID).set('value',$(thisID).get('value'));
      }
    }
  }

Unfortunately, this will set a keyup event on all "in" class inputs that will set the associated "out" to the  value of the last "in" input of the form.

I'm sure I'm missing something simple.  Could someone please point out my error?

Thank you,

JD

--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Array iteration - set keyup on input - sets all inputs to same value, not dynamic value

0 comments
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>In-Out matching</title>
  <script>
    // rate_A_B_1
    // 0123456789
    function Out2In(s) {
        return s.substr(0,5)+s[7]+s[6]+s[5]+s.substr(8);
    }
    function OnLoad() {
      var InOut = {}, o, i, in_, out, a = document.getElementById("rates").
         getElementsByTagName("input");
      // Build an index of input tags by their class names
      for (i = 0; i < a.length; i++) {
         if (a [i].className == "in")
           if (o = InOut [a [i].name])
             o.in = i;
           else  
             InOut [a [i].name] = {in:i};
         if (a [i].className == "out")
           if (o = InOut [Out2In(a [i].name)])
             o.out = i;
           else
             InOut [Out2In(a [i].name)] = {out:i};
             
      }
      // Install a onkeyup handler to the input tags with a class == 'in'
      // pointing to the tags with class == 'out'
      for (i in InOut) {
        if ((in_ = InOut[i].in) && (out = InOut[i].out)) {
          a [in_].onkeyup = function (elo, eli) {
                return function () {elo.value = eli.value;}; 
             } (a [out], a [in_]);
        }
           
      }
      
    }
    /*

What I'm trying to do is (after the form loads, when the page is ready) add 
an onkeyup event to all "in" inputs that have a matching "out" input 
(ie, an "in" A_C_1 will get an onkeyup that will set the value of "out" 
C_A_1 to its value.  But I do not want "out"s to overwrite "in"s.. 
so apply only to "in" class inputs.)
    */
  </script>
</head>
<body onload='OnLoad()'>
  <form name="rates" id="rates">
  Rate 01: <input name="rate_A_B_1" class="in"><br />
  Rate 02: <input name="rate_A_C_1" class="in"><br />
  Rate 03: <input name="rate_C_A_1" class="out"><br />
  Rate 04: <input name="rate_A_D_1" class="in"><br />
  Rate 05: <input name="rate_D_A_1" class="out"><br />
  Rate 06: <input name="rate_A_E_1" class="in"><br />
  Rate 07: <input name="rate_E_A_1" class="out"><br />
  Rate 08: <input name="rate_A_F_1" class="in"><br />
  Rate 09: <input name="rate_A_G_1" class="in"><br />
  Rate 10: <input name="rate_G_A_1" class="out"><br />
    ...
  Rate 89: <input name="rate_A_Z_1" class="in"><br />
  Rate 90: <input name="rate_B_C_1" class="in"><br />
  Rate 91: <input name="rate_C_B_1" class="out"><br />
  Rate 92: <input name="rate_B_D_1" class="in"><br />
  Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>
</body>
</html>

The above code leverages intrinsic HTML DOM methods to achieve your requested goal. No external libraries - just a clever algorithm.

When testing this page, remember to start with Rate 02 because Rate 01 has no corresponding out class.

If the format of the name string changes, you will have to alter the Out2In(...) function accordingly.

Have fun!

On Wednesday, February 5, 2014 12:33:47 PM UTC-5, Jack Drysdale Jr wrote:
Hello, everyone.

I've been working with JavaScript for a long time - nothing real fancy, mind you - but I'm scratching my head over this one.  I'm sure I'm missing something extremely simple.  I could use extra eyes, on this.

BTW, I'm in a DoD network, so sites like jsfiddle are blocked.  :(

I've got a form that will vary in length each time it's loaded.   It's dynamically generated from a database query.  I'll try to keep the pseudo-code simple.

EDIT: I forgot to add ID to the inputs in my pseudo-code.  They are there in the code on my dev system.  Sorry for the omission.

<form name="rates" id="rates">
  Rate 01: <input name="rate_A_B_1" class="in"><br />
  Rate 02: <input name="rate_A_C_1" class="in"><br />
  Rate 03: <input name="rate_C_A_1" class="out"><br />
  Rate 04: <input name="rate_A_D_1" class="in"><br />
  Rate 05: <input name="rate_D_A_1" class="out"><br />
  Rate 06: <input name="rate_A_E_1" class="in"><br />
  Rate 07: <input name="rate_E_A_1" class="out"><br />
  Rate 08: <input name="rate_A_F_1" class="in"><br />
  Rate 09: <input name="rate_A_G_1" class="in"><br />
  Rate 10: <input name="rate_G_A_1" class="out"><br />
    ...
  Rate 89: <input name="rate_A_Z_1" class="in"><br />
  Rate 90: <input name="rate_B_C_1" class="in"><br />
  Rate 91: <input name="rate_C_B_1" class="out"><br />
  Rate 92: <input name="rate_B_D_1" class="in"><br />
  Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>


What I'm trying to do is (after the form loads, when the page is ready) add an onkeyup event to all "in" inputs that have a matching "out" input (ie, an "in" A_C_1 will get an onkeyup that will set the value of "out" C_A_1 to its value.  But I do not want "out"s to overwrite "in"s.. so apply only to "in" class inputs.)

So I thought, "Simple."  Here's my js.  Although I am using MooTools for some things, I'm mixing MooTools with straight JS for this.

var inInput = $$('.in'), x, thisID, thisIDary, elmnt;
for(x in inInput){
  if(typeof(inInput[x].id) !== 'undefined'){
    thisID = inInput[x].id.trim();
    thisIDary = thisID.split("_");
    outID = thisIDary[0] + "_" + thisIDary[2] + "_" + thisIDary[1] + "_" + thisIDary[3];
    outID = outID.trim(); outID = document.id(outID);
    $(thisID).addEvent('keyup',function(){
      $(outID).set('value',$(thisID).get('value'));
      }
    }
  }

Unfortunately, this will set a keyup event on all "in" class inputs that will set the associated "out" to the  value of the last "in" input of the form.

I'm sure I'm missing something simple.  Could someone please point out my error?

Thank you,

JD

--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Help with Security

0 comments
"Hi
I have created a real time java code compiler at http://www.guru99.com/try-java-editor.html Although I have checked all security aspects … do you experts see any major flaw that I need to care of?"

--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Array iteration - set keyup on input - sets all inputs to same value, not dynamic value

Wednesday, February 5, 2014

0 comments
BTW..

"While I understand what you are trying to accomplish, I am not familiar with the method you are using (MooTools ). With that said, in reviewing the code, I tried to see if it was filtering INPUT tags with the style class IN or OUT. I do not see such a filter or IF statement.  This might be what you are missing."

The inbdInpt = $$('.inbound') is what gets only inputs that have a class of "inbound".  $$ is MooTools notation for an array, and ('.inbound') is the inbound class.  I suppose I could make it more granular by using $$('input.inbound'), but I don't think anything else has a class of inbound.. just input type="text".

JD

--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Array iteration - set keyup on input - sets all inputs to same value, not dynamic value

0 comments
Mike,

Thanks for your reply!

Believe me, I would LOVE to use jQuery instead of MooTools.  Unfortunately, I am working as part of a team (and I'm the most recently hired), and the team decided to go with MooTools, instead.  So, I am still learning it, myself.  I understand jQuery much better.

I tried creating a separate function for adding the keyup event, and got an error message stating that one of the elements is null.  I placed it inside the domready section, so I don't know why I'm getting that, as the element should exist, at that point.

MooTools also has an "each" function, but I'm getting the same issue, that way - all "in" inputs get the keyup that will apply the value of the last "in" input to all "out" inputs, instead of the associated "in" input.

I also tried putting a conditional in place, but each iteration of the for loop appears to be looping through all the "in" inputs (a loop within a loop!) for each input that I'm trying to give a keyup event to.  I thought that setting the keyup on each would get only the associated "out" instead of all of them.  I'm flaking on a piece of logic, and I'm just not seeing it.

Thank you,

JD


On Wed, Feb 5, 2014 at 12:20 PM, Michael J. Fuhrman <mfuhrman@enetarch.net> wrote:
JD,

While I understand what you are trying to accomplish, I am not familiar with the method you are using (MooTools ). With that said, in reviewing the code, I tried to see if it was filtering INPUT tags with the style class IN or OUT. I do not see such a filter or IF statement.  This might be what you are missing.

Also, I would use JQuery, and the code would look something like:

$("#rates").find("input.out").each( function (this) { this.on ("keyup", onKeyUp); } );

function onKeyUp (thisID, outID)
{ $(outID).set('value',$(thisID).get('value')); }

Note that this code may not be 100% correct, as I'm writing it off the top of my head.

$("#rates") - JQuery first finds the form with the ID rates.  If the form is not identified as RATES each time, then just use a style descriptor and search for that, or some other identifier that uniquely identifies all forms for this code.

find("input.out") - iterates through all tags below the FORM tag for INPUT tags with the CSS style OUT.

each() - is a function that iterates through the list (Array) of tags returned by find.  It accepts a nested function which allows you to attach the onKeyUp event handler to this HTML tag.

If you need to pass additional values to your onKeyUp function, then you will need to nest that function further in another function ... blah blah blah ...

As you can see, I created a separate onKeyUp function, which takes 2 parameters.  These parameters would need to be passed through the nested function in each() ...  While I think I understand what outID is referring to, I am not sure what thisID is referring to.

Hopefully this gives you some ideas on how to attach the onKeyUp event handler to just the INPUT tags with a style class specifier of OUT. 

Mike,

--

On 2/5/2014 9:33 AM, Jack Drysdale Jr wrote:
Hello, everyone.

I've been working with JavaScript for a long time - nothing real fancy, mind you - but I'm scratching my head over this one.  I'm sure I'm missing something extremely simple.  I could use extra eyes, on this.

BTW, I'm in a DoD network, so sites like jsfiddle are blocked.  :(

I've got a form that will very in length each time it's loaded.   It's dynamically generated from a database query.  I'll try to keep the pseudo-code simple.

<form name="rates" id="rates">
  Rate 01: <input name="rate_A_B_1" class="in"><br />
  Rate 02: <input name="rate_A_C_1" class="in"><br />
  Rate 03: <input name="rate_C_A_1" class="out"><br />
  Rate 04: <input name="rate_A_D_1" class="in"><br />
  Rate 05: <input name="rate_D_A_1" class="out"><br />
  Rate 06: <input name="rate_A_E_1" class="in"><br />
  Rate 07: <input name="rate_E_A_1" class="out"><br />
  Rate 08: <input name="rate_A_F_1" class="in"><br />
  Rate 09: <input name="rate_A_G_1" class="in"><br />
  Rate 10: <input name="rate_G_A_1" class="out"><br />
    ...
  Rate 89: <input name="rate_A_Z_1" class="in"><br />
  Rate 90: <input name="rate_B_C_1" class="in"><br />
  Rate 91: <input name="rate_C_B_1" class="out"><br />
  Rate 92: <input name="rate_B_D_1" class="in"><br />
  Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>


What I'm trying to do is (after the form loads, when the page is ready) add an onkeyup event to all "in" inputs that have a matching "out" input (ie, an "in" A_C_1 will get an onkeyup that will set the value of "out" C_A_1 to its value.  But I do not want "out"s to overwrite "in"s.. so apply only to "in" class inputs.)

So I thought, "Simple."  Here's my js.  Although I am using MooTools for some things, I'm mixing MooTools with straight JS for this.

var inInput = $$('.in'), x, thisID, thisIDary, elmnt;
for(x in inInput){
  if(typeof(inInput[x].id) !== 'undefined'){
    thisID = inInput[x].id.trim();
    thisIDary = thisID.split("_");
    outID = thisIDary[0] + "_" + thisIDary[2] + "_" + thisIDary[1] + "_" + thisIDary[3];
    outID = outID.trim(); outID = document.id(outID);
    $(thisID).addEvent('keyup',function(){
      $(outID).set('value',$(thisID).get('value'));
      }
    }
  }

Unfortunately, this will set a keyup event on all "in" class inputs that will set the associated "out" to the  value of the last "in" input of the form.

I'm sure I'm missing something simple.  Could someone please point out my error?

Thank you,

JD
--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: Array iteration - set keyup on input - sets all inputs to same value, not dynamic value

0 comments
JD,

While I understand what you are trying to accomplish, I am not familiar with the method you are using (MooTools ). With that said, in reviewing the code, I tried to see if it was filtering INPUT tags with the style class IN or OUT. I do not see such a filter or IF statement.  This might be what you are missing.

Also, I would use JQuery, and the code would look something like:

$("#rates").find("input.out").each( function (this) { this.on ("keyup", onKeyUp); } );

function onKeyUp (thisID, outID)
{ $(outID).set('value',$(thisID).get('value')); }

Note that this code may not be 100% correct, as I'm writing it off the top of my head.

$("#rates") - JQuery first finds the form with the ID rates.  If the form is not identified as RATES each time, then just use a style descriptor and search for that, or some other identifier that uniquely identifies all forms for this code.

find("input.out") - iterates through all tags below the FORM tag for INPUT tags with the CSS style OUT.

each() - is a function that iterates through the list (Array) of tags returned by find.  It accepts a nested function which allows you to attach the onKeyUp event handler to this HTML tag.

If you need to pass additional values to your onKeyUp function, then you will need to nest that function further in another function ... blah blah blah ...

As you can see, I created a separate onKeyUp function, which takes 2 parameters.  These parameters would need to be passed through the nested function in each() ...  While I think I understand what outID is referring to, I am not sure what thisID is referring to.

Hopefully this gives you some ideas on how to attach the onKeyUp event handler to just the INPUT tags with a style class specifier of OUT. 

Mike,

--

On 2/5/2014 9:33 AM, Jack Drysdale Jr wrote:
Hello, everyone.

I've been working with JavaScript for a long time - nothing real fancy, mind you - but I'm scratching my head over this one.  I'm sure I'm missing something extremely simple.  I could use extra eyes, on this.

BTW, I'm in a DoD network, so sites like jsfiddle are blocked.  :(

I've got a form that will very in length each time it's loaded.   It's dynamically generated from a database query.  I'll try to keep the pseudo-code simple.

<form name="rates" id="rates">
  Rate 01: <input name="rate_A_B_1" class="in"><br />
  Rate 02: <input name="rate_A_C_1" class="in"><br />
  Rate 03: <input name="rate_C_A_1" class="out"><br />
  Rate 04: <input name="rate_A_D_1" class="in"><br />
  Rate 05: <input name="rate_D_A_1" class="out"><br />
  Rate 06: <input name="rate_A_E_1" class="in"><br />
  Rate 07: <input name="rate_E_A_1" class="out"><br />
  Rate 08: <input name="rate_A_F_1" class="in"><br />
  Rate 09: <input name="rate_A_G_1" class="in"><br />
  Rate 10: <input name="rate_G_A_1" class="out"><br />
    ...
  Rate 89: <input name="rate_A_Z_1" class="in"><br />
  Rate 90: <input name="rate_B_C_1" class="in"><br />
  Rate 91: <input name="rate_C_B_1" class="out"><br />
  Rate 92: <input name="rate_B_D_1" class="in"><br />
  Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>


What I'm trying to do is (after the form loads, when the page is ready) add an onkeyup event to all "in" inputs that have a matching "out" input (ie, an "in" A_C_1 will get an onkeyup that will set the value of "out" C_A_1 to its value.  But I do not want "out"s to overwrite "in"s.. so apply only to "in" class inputs.)

So I thought, "Simple."  Here's my js.  Although I am using MooTools for some things, I'm mixing MooTools with straight JS for this.

var inInput = $$('.in'), x, thisID, thisIDary, elmnt;
for(x in inInput){
  if(typeof(inInput[x].id) !== 'undefined'){
    thisID = inInput[x].id.trim();
    thisIDary = thisID.split("_");
    outID = thisIDary[0] + "_" + thisIDary[2] + "_" + thisIDary[1] + "_" + thisIDary[3];
    outID = outID.trim(); outID = document.id(outID);
    $(thisID).addEvent('keyup',function(){
      $(outID).set('value',$(thisID).get('value'));
      }
    }
  }

Unfortunately, this will set a keyup event on all "in" class inputs that will set the associated "out" to the  value of the last "in" input of the form.

I'm sure I'm missing something simple.  Could someone please point out my error?

Thank you,

JD
--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Array iteration - set keyup on input - sets all inputs to same value, not dynamic value

0 comments
Hello, everyone.

I've been working with JavaScript for a long time - nothing real fancy, mind you - but I'm scratching my head over this one.  I'm sure I'm missing something extremely simple.  I could use extra eyes, on this.

BTW, I'm in a DoD network, so sites like jsfiddle are blocked.  :(

I've got a form that will very in length each time it's loaded.   It's dynamically generated from a database query.  I'll try to keep the pseudo-code simple.

<form name="rates" id="rates">
  Rate 01: <input name="rate_A_B_1" class="in"><br />
  Rate 02: <input name="rate_A_C_1" class="in"><br />
  Rate 03: <input name="rate_C_A_1" class="out"><br />
  Rate 04: <input name="rate_A_D_1" class="in"><br />
  Rate 05: <input name="rate_D_A_1" class="out"><br />
  Rate 06: <input name="rate_A_E_1" class="in"><br />
  Rate 07: <input name="rate_E_A_1" class="out"><br />
  Rate 08: <input name="rate_A_F_1" class="in"><br />
  Rate 09: <input name="rate_A_G_1" class="in"><br />
  Rate 10: <input name="rate_G_A_1" class="out"><br />
    ...
  Rate 89: <input name="rate_A_Z_1" class="in"><br />
  Rate 90: <input name="rate_B_C_1" class="in"><br />
  Rate 91: <input name="rate_C_B_1" class="out"><br />
  Rate 92: <input name="rate_B_D_1" class="in"><br />
  Rate 93: <input name="rate_D_B_1" class="out"><br />
</form>


What I'm trying to do is (after the form loads, when the page is ready) add an onkeyup event to all "in" inputs that have a matching "out" input (ie, an "in" A_C_1 will get an onkeyup that will set the value of "out" C_A_1 to its value.  But I do not want "out"s to overwrite "in"s.. so apply only to "in" class inputs.)

So I thought, "Simple."  Here's my js.  Although I am using MooTools for some things, I'm mixing MooTools with straight JS for this.

var inInput = $$('.in'), x, thisID, thisIDary, elmnt;
for(x in inInput){
  if(typeof(inInput[x].id) !== 'undefined'){
    thisID = inInput[x].id.trim();
    thisIDary = thisID.split("_");
    outID = thisIDary[0] + "_" + thisIDary[2] + "_" + thisIDary[1] + "_" + thisIDary[3];
    outID = outID.trim(); outID = document.id(outID);
    $(thisID).addEvent('keyup',function(){
      $(outID).set('value',$(thisID).get('value'));
      }
    }
  }

Unfortunately, this will set a keyup event on all "in" class inputs that will set the associated "out" to the  value of the last "in" input of the form.

I'm sure I'm missing something simple.  Could someone please point out my error?

Thank you,

JD

--
You received this message because you are subscribed to the Google Groups "JavaScript Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javascript-information+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Copyright © 2010 Web Design | Free Blogger Templates by Splashy Templates | Layout by Atomic Website Templates

Vida de bombeiro Recipes Informatica Humor Jokes Mensagens Curiosity Saude Video Games Animals Diario das Mensagens Eletronica Rei Jesus News Noticias da TV Artesanato Esportes Noticias Atuais Games Pets Career Religion Recreation Business Education Autos Academics Style Television Programming Motosport Humor News The Games Home Downs World News Internet Design Entertaimment Celebrities 1001 Games Doctor Pets Net Downs World Enter Jesus Mensagensr Android Rub Letras Dialogue cosmetics Genexus lasofia thebushrajr wingshock tripedes gorduravegetal dainfamia dejavu-transpersonal jsbenfica republicadasbadanas ruiherbon iranianforaryans eaystcheyl fotosdanadir Só Humor Curiosity Gifs Medical Female American Health Madeira Designer PPS Divertidas Estate Travel Estate Writing Computer Matilde Ocultos Matilde futebolcomnoticias girassol lettheworldturn topdigitalnet Bem amado enjohnny produceideas foodasticos cronicasdoimaginario downloadsdegraca compactandoletras newcuriosidades blogdoarmario arrozinhoii