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
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
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/
-- 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
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/
-- 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
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:
"HiI 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
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:
-- 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// 0123456789function 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 namesfor (i = 0; i < a.length; i++) {if (a [i].className == "in")if (o = InOut [a [i].name])o.in = i;elseInOut [a [i].name] = {in:i};if (a [i].className == "out")if (o = InOut [Out2In(a [i].name)])o.out = i;elseInOut [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) addan 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
Note to Moderator:
On Wednesday, February 5, 2014 12:33:47 PM UTC-5, Jack Drysdale Jr wrote:
-- 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
<!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
<!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.
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
"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
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."
-- "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
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
Mike,
Thanks for your reply!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.
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
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,
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
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.
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.
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
-- 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.
Subscribe to:
Posts (Atom)