What I'm trying to do here should be simple and I suspect that I'm just overlooking something basic but I'm overlooking it. If you can tell me what I'm not seeing here, I'll be most grateful. This is the associated HTML code. Two statements to be rated from 1 to 10 using radio buttons.
<tr>
<td width="25"><strong>A</strong></td>
<td width="210">A statement is here</td>
<td width="21"><input type="radio" name="SI_QA" id="SI_QA_1" value="1" /></td>
(total of 10 lines like this)
My validate() function is not working quite right since it should validate for at least on checkbox checked and even if opne is checked it will simply display the error message instead of validating. What might be wrong here?
Here's the function (note, all the checkboxes have the id='chk')
function validate(){ var countChecks = 0; if (document.forms.getElementById == "chk") { for (var j in document.forms.getElementById) if (j.checked) countChecks++; } if (!countChecks) { alert('Select some checkboxes!') return false; }}
I am by no means a JS programmer, but I like to exhaust all avenues when attacking an issue. A signature fired off on a piece of javascript that came across the wire, with an odd "var unescape" inside of it. I am hoping to throw this code out there, to see if anyone has any insight on what this might be.
I am assuming this is double encoded, but I am not certain. Here is the snippet of code the signature fired off from:
var ibdf=unescape("%u0b0b%u0b0"+"b"); var fdofdopf="xcvb9090";
I've experienced have been down to IE (trailing commas in arrays, etc). This latest problem stops a page which works great in IE and chrome working at all in FF.
The code below basically loads a table of data by post request. Then applies various functinalities to the elements contained within the loaded data. In FF the table which should be loaded by post request just does not display at all.
function update_table_row(obj){ var rel = $(obj).attr('rel'); $('input#submit_'+rel).removeAttr('disabled'); $('tr#row_'+rel+' td').css('background-color','pink');
Does the world need another DHTML popup calendar? Probably not, but I'm writing one anyway. It's unique in that it allows drag selection of a range of dates. Works great on IE6 but I'm having some trouble with Netscape and events. In particular, the mousedown event doesn't work. The event fires, but I can't seem to get a handle on what html element was clicked.
I have web video player that can display adds by inserting a div tag on top of the player after an amount of seconds that I specify.
I would like to manipulate the content of the div tag with jquery but I can't do this since the div tag is not present when the document is loaded.
I have looked into several options.
But all the solutions seems to rely on an event to happen - a link is clicked, some element is mouseovered and then jquery runs throug the DOM again.
But in this case no event occurs! The user click play (on a flash player) remove the hand from the mouse and 15 secs later the div tag with the add is displayed.
Is there any way to select this div tag and manipulate the content?
I'm trying to pass data I gathered from a prompt into a later function.
1. Should prompts for information be in their own JS file separate from the HTML page? Or is it better form to have the prompts (for info) in the HTML page itself?
2. I have tried placing the prompts to gather info in several places, each time my script seems to stop after the data is gathered and does not perform the calculations which are contained within a function. The input data is gathered from a prompt, do I still need to "return valuea" and "return valueb" in order to use the input data in the calculation function? Initially I did not feel I did, as I am not performing a calculation initially, just receiving input.
EBay has implemented a different way to upload auction pictures --- after browsing for the picture and selecting it, the image preview instantly displays on the screen, which is nice. Apparently this process is being handled locally --- could someone try to re-create this ? ... I imagine its using DHTML or some other technique, I'm not sure how I would code this.
[URL] I'd also like to use this plugin, so I don't have to create complex validation rules. validation plugin [URL]Trouble is, I can't figure out how to prevent form submission without first checking to see if the form is valid. My attempts so far have been based on using submit() to prevent submission of the form if validations valid() method returns false. But this doesn't seem to work. If I use ajaxForm, the submit() function seems to work differently. A form will still be submitted, despite a return false. validate has a valid() method that returns false if the form fails validation. How can I submit the form only if valid doesn't return false?
<script language=javascript> function getSelText() { var txt = '';
[code]....
how do i identify the frames?.. document.getSelection(); and window.getSelection() only work for the frame the code is on. how do i change these getSelection(); for specific frame? i tried copying code to top frame but doesn't work. i tried changing to this but no success
I use named anchors to take users to specific parts of a long page. But I want to add some processing and do some things with my nav bar when users go to certain sections delineated by named anchors. I understand that the anchors array creates an element for each anchor in the page when the page is loaded, but how do I identify which anchor is currently being viewed?
Here's some pseudo code:
if (document.anchors.name == "section_B") {
then do this or that
}
But what do I test to determine the current anchor name?
What about using id's instead of names? Can the anchors array return anchors created with id's as well as names? Would this be of any benefit?
I have jsp1.jsp with an iframe iframe1.jsp within. Once the http session is expired any page is redirected to a logout1.jsp page.
If the iframe1.jsp was loaded and httpsession expired the logout1.jsp is displayed inside the iframe .... but I want it to be displayed on the full screen.
My idea is to check once loading the logout1.jsp if it is inside an iframe and to reload it's parent. I tried following lines within the logout.jsp. It worked well, but caused an infinite loop ...
if (window.parent != null ) window.parent.location.reload();
I guess it is not the correct way to check if a window is within an iframe...
I have a div that is identified by a class name of .thumbs, and Inside this div are numerous thumnail images.
I was hoping to be able to click on any one of the images and pass back information, such as image src, to a function for some type of processing. The problem is that there are many thumbails and adding an id to each would be very arduous and not very dynamic.
I'm having a hard time wrapping my head around the logic needed to solve this problem.
I have a form with multiple SELECT drop-down menus. Each menu can submit the form using the onChange function. How can I determine which of the drop-down menus was used to submit the form? Example:
The following javascript coding is used in a "select a city" dropbox.
I made a submit button. I want the button to redirect the page to "page1.html". "page1.html" will be a webpage with events located in Auburn, Alabama, United States.
My submit button:
Here is my function:
Right now my button doesn't recognize if i select "Auburn", so it never sends me to "page1.html". Can someone please help me write the correct if statement?
The best way to describe what im trying to accomplish is with a code snippet. Im using the free .NET ajax library.
<script language='javascript'> function proc1() { myFunc("MyCodeBehind.MyAjaxProc"); } function myFunc(procName) { procName("My Parameter", processMyFunc); } function processMyFunc(response) { // Process response from the server } </script>
So im essentially invoking an Ajax function , but I cant explicitly use the name of it like so