I have a list of checkboxes with Ids that go something like;
chk_AGE=16
chk_AGE=17
chk_AGE=18
[code].....
When a user checks/unchecks '16' (for example), I want javascript to look up how many checkboxes in my form have an Id that begins with "chk_AGE" and return the number in an alert box ("3" in this case).If my user had checked/unchecked "Officer" an alert box would return "2" as there are 2 checkboxes that begin "chk_RANK".
How would I adapt it to change the outcome? I don't want to limit access to the webpage. I do want to take the incoming referral URLs and put them in a text file for my review? I think this could help me solve a problem at my website where I want to identify the source of an extraordinary number of referals to a particular page. Code:
If you have a collection of submit buttons on one page, and an OnSubmit event fired on the Form, how can you find out the ID of the button clicked, triggering the form submit? Code:
Its like xyz.com/index.html is hosted under us and it can be edited by many people. Some spammers edit the above index.html to javascript redirect to abc.com. I want to figure out this pages in my site xyz.com .Is there any way to track the abc.com domain on unload of the page xyz.com . Please let me know if you need any more information.
I have a function, triggered when a particular type of link is clicked,which collects and inserts some text after the parent of the clicked link. This function works fine when the parent is a p tag, but I'm having trouble when the link is within a list tag. In this instance I would want the new text to be presented after the closing list item tag. How do can I distinguish whether the clicked link is within a p tag or within an li tag?
<tt>function fnGetSnippet(ni){ $.get("../scripts/ajax_fsheets.asp?id=getDD&ddID=" + ni + "&q=" + new Date().getTime(), function(responseText){ <x-tab></x-tab>
I wish to identify the option chosen in the function but not by its value, by its position:
<script> function goHere(){ var s = document.getElementById("input");
[code]....
I was hoping that variable "u" would be either 0, 1, 2, or 3.How can I get a variable to alert me the position of the selected option in the form? I think it is elements[i].
Anyone know if there's a simple way of revealing all elements on a page that have a title attribute? I want to stick a script in a favelet to use as a development tool (highlight all titled elements with red border, etc)
I don't want it to be limited just to links or form elements.
If there's not something already out there, I'll probably have a hack at some existing favelets I have on my site, but no harm in asking if one's out there already, eh?
Is there someway of identifying from which filed the function was called.
<html> <head> <script language="JavaScript"> function calLeaveCutting(){
how can i identify here from which input field this function was called I can use getElementByid, but if i do so i need check all the field. I don't want that to happen. Is there someway of identifying from which filed this function was called.
When we refresh the page (F5, or icon in browser), it will first trigger ONUNLOAD event and then trigger ONLOAD event. When we close the browser (X on right top icon), it will trigger ONUNLOAD event.
Now when ONUNLOAD event is triggered, there is no way to distinguish between refresh the page or close the browser.
Here's the code fragment. The logic in window_unload() only applies to closing the browser, not refreshing the page.
<BODY ONUNLOAD="window_unload()"> function window_unload() {//logic that only applies to close the browser, not refresh the page. }
I would like to use one or more RegExps to validate country names as having the first and last words beginning with an uppercase letter, intermediate words beginning with either uppercase or lowercase, and all other characters being lowercase characters. For example:
Turks and Caicos
The difficult part is that I want to obtain save the string positions of the invalid characters in an array, rather than just obtain a true or false value.
Can anybody with more experience with Regular Expressions than me suggest some code, sites, or approaches.
I am developing a fairly complicated application with a lot of JavaScript and making use of JQuery. The application repeatedly makes simultaneous GET requests.
I am looking for a way of assigning a unique token to each request when it is made, so that I can store information about that request and cache the request / response combo, when using $.get() (or potentially $.ajax() if required for the extra functionality).
So far I have not had any joy and after a while googling this am none the wiser. I have used similar functionality in Flex 3 with the AsyncToken object which can maintain data between HTTP request / response.
I'm new to js and jquery. I need to get access to select forms which are named dynamically. I have no problem when named statically, so this works fine:
What I want to do is change the border of several images on the page to show a 4px border. There are many images on the page so I just want to call the changeborder() function on the onClick event so as the image that has been clicked changes. However, I don't think using this.style.border to identify the element works when placed within the function. That is, how do I identify, from the function, which image has been clicked? My current code (which does not work) looks like this but I am sure its possible to gather what i'm trying to achieve:
If it is possible, how to reflect popup checkbox changes on same checkbox in parent window. Main windows contains a list of thumbnails, each one with a checkbox. Clicking on a thumb, a popup window is opened containing a bigger photo beside a checkbox. If the user checks/uncheks it I want the thumbnail checkbox in parent window to be changed in the same way (and onclick tasks to be performed). To achieve this I am using cookies and onClick -> parent.reload.
My JSP web page has many checkboxes. What is web page source code look like when clicking one checkbox will submit only one checkbox value (not the whole form) immediately? i.e. toggling one checkbox will send the info that only that checkbox is toggled. This does not work because clicking one checkbox will send the whole page
My JSP web page has many checkboxes.What is web page source code look like when clicking one checkbox will submit only one checkbox value (not the whole form) immediately? i.e. toggling one checkbox will send the info that only that checkbox is toggled.This does not work because clicking one checkbox will send the whole page [code]
I have an HTML page, that calls an ASP javascript page on "Submit". Everything works correctly except that I can't get the value of the checkboxes. I've been trying code like this:
var s = "Off" if (Request.Form("EmailCbx").Checked == true) {s = Request.Form("EmailCbx").name}
No matter what I do (I've tried several other things too) the value always returns as "Off" What am I doing wrong?
Also, is there some way to get values from all my checkboxes that are checked?
I've been able to disable a checkbox when needed. This is fine, but on my website, you don't really see that the checkbox is disabled. Does it exist a way to show a red X in the middle of the checkbox instead of disable it, and also avoid a user to click on it ?