I have this form and in it I have this:
<%= f.select(:category_id, categories_for_select) %>
<%= f.select(:subcategory_id, options_for_select(["Choose category"])) %>
Then, when the user change the category the subcategories select box fill itself via ajax.
Both of the category and subcategory are mandatory for my model and included ...
Hi all,
How to clear the session ?
Gnaniyar Zubair
...
There are several ways to define click action on anchor tag like:
<a href="javascript: void(0)" onclick="funciton_X()">click here</a>
or
<a href="javascript: funciton_X()">click here</a>
or
<a id="a_tag" href="javascript: void(0)">click here</a>
<script type="text/javascript">
$('#a_tag').click(function(){})
</script>
...
Possible Duplicate:
Changing a CSS rule-set from Javascript
Dear experts,
Is there a way to dynamically generate a CSS stylesheets using Javascript according to what the users fill in on a form (user interface)?
If this isn't possible with Javascript, could someone point me to the right direction. Ruby on rails would also be...
Does a browser process these two snippets the same way?:
<script type="javascript">
myFunction1();
myFunction2();
</script>
Vs.
<script type="javascript">
myFunction1();
</script>
<script type="javascript">
myFunction2();
</script>
...
Hi,
My webapp currently employs a JS based error logging system for reporting JS error on the client side.
The problem with logging your error using javascript is just that - we are using a technology to monitor problems in that same technology.
Easily an error in the JS could prevent the logging from occuring.
I was wondering if anyone...
Hello,
i develop a website and i need let the document title blinking when the browser lost the focus to get the attention from the user.
This is a common task for example in some social network. Btw my javascript code work fine in Chrome, Firefox, Opera, but not in IE7 (that i am testing before release the site)
IE7 have a strange be...
I have an issue with jquery where elements are not found when the query string has '$' char in them -- is there a known issue? Unfortunately search engines make it so hard to searh for symbols in threads.
I have an html such as this:
<TD id="ctl00$m$g_cd3cd7fd_df51_4f95_9057_d98f0c1e1d60$ctl00$ctl00_5"
class="MenuItem"
onclick...
Dear Programmers,
I want to make a website that would be like craiglist.org. If you go the site and click on any of the city it will redirects you to the city subdomain. And after that anytime you go to the craiglist.org it will redirect you to the city subdomain. So I need to keep the city/country name to my client's machine.
At first...
Good afternoon,
I ran into some issues storing data. Let's say I can make a note, which contains the content of the note, an ID, timestamp, all that good stuff. I want to store my notes in an associative array, called notes, via each note's ID. So in a method, we have:
{
var note = this.makeNote(...);
var someID = note.id;
this.note...
Hi, I was following along to this post by Rebecca Murphey: http://blog.rebeccamurphey.com/scaffolding-a-buildable-dojo-application
I was substituting her file structure with my own.
Running the normal version of the scripts works fine, but the moment I compile them using the build tool, the script errors.
It's very likely a small prob...
Hi
Quite simply, I have a SWF embedded in an HTML web page and want to move to a specific frame when a trigger is clicked.
But nothing happens when I click the trigger, as though the js just doesnt communicate at all with the swf.
SWF is written in flash cs4 (a3)
The link to the website is http://simplywebdzine.com/test.html.
I have read...
I am planning on making an order form that has
text fields (to gather submitted text based information like names, emails, messages)
link fields (to gather submitted links)
upload buttons (to gather images from a user's hard drive)
I assume I will be using Javascript and Ruby for this but I have a few questions.
how would I activa...
In my app I load different SVG files and need to zoom them. As I see it I need to apply a transformation matrix to an element to have it zoomed, but this doesn't work on SVG element, so I need to wrap everything in a <g> and transform it instead.
So my question is is it safe to do this? Is it allowed for elements like <defs> be not im...
I'm trying to create a book type interface that has 'pages', and the user can manually resize text, the catch is that I don't want the text to ever scroll.
I was using the
studio HTML5 demo as a starting point, the problem is as any given text is allocated to one slide, so as the text size is increased the slide sizes just increase and...
A while ago a colleague of mine said something astonishing to me: he said that one can format a hard drive using javascript! I just replied 'no, this is impossible'. He seemed to be very confident however, although he also mentioned that this is possible for windows only... Since then I can't give up thinking on it, but I haven't found a...
Hey,
i am using the jquery toggle function like this:
$(".class").toggle(
function() {
//things to do... animations and so on
},
function(){
// other things to do...
}
);
Now when I call the toggle effect by clicking very often the animations of the two functions don't wait for the other to finish. So I would like...
I have an input field that saves a URL, I'd like this saved input to recognize when "Http//" is absent from the start of the variable but have no idea where to begin... is it possible to check only a portion of a string? - then have a function that will append if necessary?
...
jQuery hashchange event
For me it looks like most mature solution right now(please correct me if I'm wrong).
I really like this plugin for manipulating with browsers hashes. It simplifies js code a lot in some cases.
I really want to start use it extensively but I have a question for you.
Accordingly to the source it uses loop and che...
Want to move one image close to other image on the basis of CSS margin calculation in Javascript. I am basically a game developer So that is why i used physics vector movement formula this thing works in C++, but not over here. Can any body guide me what wrong i am doing. As one more thing i notice that the margin i specified in CSS is n...