Displaying 3 results from an estimated 3 matches for "somearray".
2007 Jan 19
7
Prototype.js: Is there an "in_array"-like function?
...y to search for a item within an
array. Here is my approach for this functionality. It''s an prototype
for an Array method called "has":
Array.prototype.has = function(needle) {
for (var i=0;i<this.length;i++) {
if(this[i] == needle){ return true; }
}
return false;
}
var someArray = [''jim'', ''marge'', ''timmeh'', ''bob''];
if( someArray.has(''bob'') )
{
alert(''found bob'')
}
Isn''t there something like "has()" in prototype already? I have seen
the find /...
2008 Jan 18
1
validation - writeback in forms
hallo,
i have a form like this:
<% form_tag :action => "foo1"
<%=select_tag ("user", "name", options_for_select(someArray))%>
<%=select_tag ("formdata", "language1",
options_for_select(someArray))%>
<%=radio_button ("formdata", "language1_level, 3%>
<% end>
the controller has 2 functions, foo0 (displays the formular) and foo1
(validates data in params[:u...
2007 Sep 12
2
Prototype.js and Coremetrics eluminate.js issues
Hi,
I am trying to use prototype.js on a JSP that also contains some
javascript from Coremetrics (eluminate.js). Coremetrics is used for
tracking marketing clicks.
When I have both of these javascript imports on the page I get
javascript errors in the eluminate.js file. I get javascript errors
that say "Undeterminate string constant."
It looks like the prototype.js file is somehow