Displaying 20 results from an estimated 3000 matches similar to: "DOM builder and HTML events"
2008 Dec 13
2
What is "The Rails Way" to do this?
I have a PHP application with the following in one of the "views":
<input type="button" onClick="newAlt()" value=" + "></nobr>
The JavaScript for "newAlt()" is:
// using DOM create new input box for alternate part
function newAlt() {
var html = "<input style=''background-color:#FFFFCC'' ";
html +=
2009 Jul 24
6
Routes from raw js (using XMLHttpRequest)
I am making an ajax call from js to call a method (assocboxchange) in
my controller (AssociatesController), using XMLHttpRequest. I know
the XMLHttpRequest works fine because I use it in other places with
success. My problem is my URL I am using for this request doesn;t
access the method in my controller which I (think) I am specifying. I
am having it post to /channels/assocboxchange/" with
2006 Apr 24
1
implementing a Slider control
i''m trying to implement a slider like
"http://wiki.script.aculo.us/scriptaculous/show/SliderDemo", but i see
that my code doesnt work.
i seem to do everything correct but then if some one could look into it
and help..
regards
muddana
The View Code:
<%= javascript_include_tag "prototype", "effects"
2006 Jan 30
5
RE: sortable list question
Assuming that $(ids[i]) is the hidden input field, wouldn''t the
following line need to reference it as a form element?
> $(ids[i]).innerHTML = i;
I would assume it should be (the "'''' + " makes it a string, not sure if
you can set a form element value to an int, maybe you can):
$(ids[i]).value = '''' + i;
Or maybe I''m not
2006 May 20
1
Slider.js - Attemting to put values in form.
I can''t figure out how to take that value that the user has chosen in
the slider and put that into a form value. Does anybody know how to do
this?
Here is my code so far (It''s pretty much directly from script.aculo.us):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Text effects tests</title>
<script
2006 Aug 15
2
Extracting the current value of a DOM element
So, say I have two select boxes. One with the letters of the alphabet,
and a second with a list of names. When I select the letter in the
first, how do I, in my onChange function, extract the value I selected
in the first box, to determine what values to populate the second box
with?
I don''t want to submit the form, I''d like to do this with Ajax.
Thanks in advance,
Ben.
--
2006 Feb 07
1
onHover: can u explain me this function ?
In Sortables, we have a function onHover:
onHover: function(element, dropon, overlap) {
if(overlap>0.5) {
Sortable.mark(dropon, ''before'');
if(dropon.previousSibling != element) {
var oldParentNode = element.parentNode;
element.style.visibility = "hidden"; // fix gecko rendering
2005 Oct 17
11
a better question
I''m trying to call a click() event on an <a href> that has an
Observable registered for it. Something like:
<a href="#" id="toggle_1929">show</a>
...
Event.observe("toggle_1929", ''click'', function(event){ Element.toggle
("group_1929"); return false; });
...
$("toggle_1929").click(); //this throws
2006 Jun 14
4
Select box onchange problem
Hi,
i''ve got the following problem. I have a check_box witch shows
a list of varieties. Now i want to call a action when the user
changes his selection. (the method to be called, will store the
selection from the user).
This is my code:
<%= select(''variety'', ''variety_id'',
Variety.find_all.collect {|c| [c.description, c.id]},
2006 Apr 12
22
Dynamic Select Box
Hi,
I''m new to rails/ruby having come from PHP and am just starting to get
my head round how easy it can be :)
However, can anyone point me in the right direction for dynamicaly
updating a select box based upon the choice of a previous select box,
without a page refresh.
Any and all help greatly appreciated.
Thanks
--
Posted via http://www.ruby-forum.com/.
2006 Mar 07
6
how to add onchange javascript event to select field
I would like to add javascript ''onChange'' event handling for a select
field, such as
<%= collection_select("job", "client_id" , @clients, "id", "name") %>
with onChange="xxx"
Anyone know how to make this work?
Thank you,
Scott
--
Posted via http://www.ruby-forum.com/.
2006 Nov 23
3
Prototype Safari onSubmit Issues
Hi folks. Another Prototype question.
I have a simple ajax form which I want to return results on an
onChange. Works in IE6 (Win) and FF, but Safari doesn''t seem to take
the onChange too well. Upon the return key, it blanks out the form.
Upon tabbing to the next field (actually the next form), I get the
results.
<form name="form1" id="form1"
2006 Jan 31
5
resizing multiple images using getElementsByClassName
I am building a iPhoto like (Read rip-off) interface for thumbnails
and I am having a couple problems that I thought some one on the list
might be able to assist me on ...
first off here is the page: http://v4.incontrolsolutions.com/galltest/
I am no Javascript whizz and I am sure there is a FAR more efficient
way to do what I am trying. Having said that, the 2 things I was
looking for
2006 Mar 29
4
using onchange options in forms
Hello,
I''m trying to get a select field to update a view via the ''onchange''
option. I''ve seen examples of it here in the forum where people hardcode
the forms and use javascript to trigger the change (and nearly all have
complained that it''s a hack) and I''m wondering if anyone has a more
elegant solution using the embedded ruby methods?
2006 Aug 01
6
Newbie: How to use text_field with Java Script
<input type="text" name="date1" id="dateField1"
onchange="magicDate(''dateField1'');" onfocus="if (this.className !=
''error'') this.select()" />
How could I generate above text filed using ruby?
I am not sure how to give the options such as onchange, onfocus, id and
so on?
could some one please help.
--
2006 Oct 28
2
onchange="document.forms[0].submit()" - how to CANCEL
Goal: I want to auto-send a form whenever any field changes. The page
will be updated "via Ajax", so standard submission is cancelled.
Idea: Add onchange="document.forms[0].submit();" to every field
Problem: Can not cancel form submission. Browser redirects to "results"
page, which is of course JavaScript meant to dynamically update the
page.
RHTML snippet:
2005 Oct 14
2
events after sort
hi,
i''ve just started use prototype.js et al, i am currently creating a sortable
list with:
Sortable.create(''id'', { onChange: myFunc });
but what i really want is an event that occurs after the li''s have been
reordered and settled into the new list order.
how would i do that?
i know i can do for exampe:
Event.observe(''id'',
2007 Jun 22
1
nested rest URL => passing param from select
Hi,
I''m trying to create a select box with an onchange event. When onchange
is fired, I want to redirect to a nested rest url. The problem is that I
don''t know how to pass the selected value to the url:
<select id="category" onchange=" <%= remote_function(:url =>
category_articles_path(selected value?) ) %> ">
Any suggestions?
--
Posted
2006 Aug 07
2
Select Box Question
Hi,
Yet another newbie here... I''m writing an appliction in Rails, and I''ve
Ajaxified my select boxes so they update dynamically. I used the
"observe_field" method to monitor changes to my select box. I find that
it''s kind of erratic... it updates constantly and makes the selection
for me, based on where my mouse happens to be hovering when it does its
2005 Dec 21
3
How to make a drop-down automatically submit an AJAX form
Hi,
I know that to make a dropdown box automatically submit when you change
the value, you do this:
<select ..... onchange="this.form.submit();">
BUT i''ve got an ajax form, and if i do the above trick, it simply
reloads the ajax partial into the whole screen, rather than into the div
where it is meant to go.
I''ve already got it all working so that if you click