V
Void
Hello,
I'm new to Ruby and into di ng, but I hope to find a solution to the problem
I'm facing. I need to make a quick script to put some values into some text
fileds in a web page. This should be simple:
[...]
$ff=Firefox.new
[...]
$ff.formname,"page2").text_fieldname,"dd1").set(start_date.day.to_s)
[...]
BUT: there is a javascript check in the web page that raise an alert if the
key pressed is not numeric:
function onKeyNumeric(e) {
if ( ((e.keyCode >= 48) && (e.keyCode <= 57)) ||
((e.keyCode >= 35) && (e.keyCode <= 40)) ||
((e.keyCode >= 45) && (e.keyCode <= 46)) ||
((e.keyCode >= 08) && (e.keyCode <= 09)) ||
(e.keyCode >= 12) ) {
return true;
} else {
alert ("Numeric only values accepted.");
return false;
}
}
I tried to set a "start_date.day.to_i", but I got an error such as only
string values could be put in.
Any ideas?
By the way, what does the following line mean? I don't understand its
syntax:
request = /javascript:sel.'#{links[index]}','/
Bye,
Void
I'm new to Ruby and into di ng, but I hope to find a solution to the problem
I'm facing. I need to make a quick script to put some values into some text
fileds in a web page. This should be simple:
[...]
$ff=Firefox.new
[...]
$ff.formname,"page2").text_fieldname,"dd1").set(start_date.day.to_s)
[...]
BUT: there is a javascript check in the web page that raise an alert if the
key pressed is not numeric:
function onKeyNumeric(e) {
if ( ((e.keyCode >= 48) && (e.keyCode <= 57)) ||
((e.keyCode >= 35) && (e.keyCode <= 40)) ||
((e.keyCode >= 45) && (e.keyCode <= 46)) ||
((e.keyCode >= 08) && (e.keyCode <= 09)) ||
(e.keyCode >= 12) ) {
return true;
} else {
alert ("Numeric only values accepted.");
return false;
}
}
I tried to set a "start_date.day.to_i", but I got an error such as only
string values could be put in.
Any ideas?
By the way, what does the following line mean? I don't understand its
syntax:
request = /javascript:sel.'#{links[index]}','/
Bye,
Void