To stop the keyboard event for the F4-key from propagating in IE I need
to set event.keyCode to 0. But setting keyCode to 0 in Mozilla/Firefox
will throw an exception since it is a read-only property.
So, how do I check if event.keyCode is writable?
(I could do some check to see if the script is run in IE or add a
try/catch for Mozilla, but I would like to know the 'correct' method)
I'm using ccs3PIE with my site. What I want to do is check if a DOM element has a css property like border-radius and then add a class to it.
The problem I'm having is that I don't know how to check for the css property. I've been searching for it for a couple of hours now and I can't find anything that seems to work.
I wrote a small piece of javascript a while ago to add some text to a text box and mark it as read only if a check box was checked. If the checkbox was unchecked, the text would be removed and the field writable.
It was working great until I accadently deleted the file and had to start over from an old backup that didn't have the new functionality.. Now I have it so if you check the box, it puts the correct text, and marks the field read only, hoverer now I can't uncheck the checkbox.
Here is the HTML: [URL] I'm trying to uncheck the selected radio button, then set the value to 1 (Yes), basically overwriting theinitialvalue to 1. I've looked at prop(), val(), and attr(), and just don't know where to start. Should I select $('#set_q157 input') or$('#set_q157 input:radio'), or each individual radio?
Do I need to each them, and check if its checked, then change its value, or is there a way to select all three inputs as just one radial button? It would also need to work if the input has not yet been checked.
i have a list of checkboxes, the number of checkboxes is dynamic. All the checkboxes have same name. i am trying to get the length of selected checkboxes.
when i try to get the length in javascript like document.form.name1.length, it works fine if number of checkboxes selected are more than 1, but not for 1.
I have a code that I got from a tutorial website. The goal is when someone clicks the first check box with the value of yes then the two other sets of check boxes will autmatically be checked for no.
The issue is their are three sets of 2 check boxes each.
So here is my code code I am trying to use
PHP Code:
Here is my form code
PHP Code:
So Ideally when a representative clicks that the customer has three services (clicks the Yes checkbox) all the other checkboxes will default to No.
How I would change the above javascript to do this.
I am a php programmer and not a Javascript programmer and I am trying to help a friend out with his shopping cart. The original programmer (who wrote this years ago and is no longer around) has a button that looks up the quantities in the database for the submitted items, and then displays a prompt if you selected a quantity that is less than the minimum purchase amount.The issue is if the user enters a smaller amount than allowed and hits the enter key instead of the "Buy" button, it allows the order.how to use the current code to also check for an Enter key submission.I can handle the PHP and the db lookup for minimum quantities. Here is the page code and the Javascript code.
I have an .asp page for my customers which does just accepts e-mail information and passes this information to another .asp page. But before passing the info, a javascript checks whether the entered e-mail does match some certain rules. Rule1: If any input has been made at all, Rule2: If an "@" sign is there, if the"." is there and so on. upon pressing the submit button, the first rule works but the second rule does not. Could not figure it out why.
[Code]...
It is the function control() which validates the e-mail field. But it just validates whether the e-mail has been entered or not. The second check (with the @ sign) is not being made.
I'm working a bunch of pre existing code on a CMS. Just after a quick fix. Doing a show/hide thing on a particular div somewhere on the page depending if a checkbox is ticked or not.Currently there is 3 checkboxes that are dynamically added through the CMS. Here's simplified version of the form:
I want when checkbox is checked, the span will have 500 USD. When checkbox is unchecked the span will return 0.This is what I've got, have no idea why not work.
Code JavaScript: if ($('#priority').is(':checked')) { $('.presult').text('500 USD');
I'm sending arrays of results from my server in response to an xmlhttprequest like so:
array({key:value[,...]}[,...]);
I know I could use an associative or indexed array, but this is just how I wrote it as I'm using the prototype library and I'm in the habit. Anyway, I want to know if I can reference 'key'. If so, umm, how?
I'm using javascript to dynamically make controls show up or disappear on a form. For some reason, if I load a control (in this case a select control) into the Div it shows up perfectly. If I load text in there, it is fine too. However, if I programmatically try to go from the select control content and cover it with text afterwards, that won't work.
If I change the content from one string to another, it works as well. I just cannot remove a control I've put down and replace it with text or "" or whatever.
I just wrote this script which loops through all of the CSS properties for an element, and dynamically generates an HTML document using a for/in loop in a new window which is a table of all CSS properties and values for the element. Some may find it useful.
({}["toString"]) - function alert("toString" in {}) - true
But I want to only find a property that is defined in the object - not in a prototype.
for(var prop in {}) { alert(prop); }; // toString not found.
It seems that operator 'in' is overloaded. 'in' during iteration: look in the property. 'in' in a boolean conditional: look in the object, then up the prototype chain.
I want a way to get only properties defined within the object itself, not it's prototype. Is there no simple way?
i am developing an application , we have to run it for Netscape V4.76(!!) , the problem is it seems that Netscape V4.76 does not support 'disabled' for form elements for example something like
I would like to override the "disabled" property of a hidden field. When disabled is set to "true", it would call a function to disable 2 other text fields on the form. When disabled is set to "false", it would enable those 2 text fields. You should also be able to get the value of it as if it were a property:
I have a script that I want to run only when my input box IS NOT disabled. Can someone tell me if something is wrong with my script? Is "disabled" the correct property to use?
function TextChanged(i){ if (!document.ScheduleForm["txtGrossPayroll" + i].disabled) { document.ScheduleForm.txtRecordStatus.value = "Changes Made; Record Not Saved.";
var x =window.open('http://localhost/canvas.html','myokno') var w =x.width Permission denied to get property Window.width var w =x.innerWidth
Permission denied to get property Window.innerWidth why i can get properties of new created window??? The second problem is much more important: i want to get element which id is "canvas" and it is in new window so i do like this:
var canvas = myokno.document.getElementById('canvas') ReferenceError: myokno is not defined var canvas = x.document.getElementById('canvas') Permission denied to call method HTMLDocument.getElementById
so i start working on the problem and: var can = x.document can [object HTMLDocument] var can2 = can.getElementById('canvas') Permission denied to call method HTMLDocument.getElementById
I am writing a Javascript UI component. I have already written a "disable()" method for it, but I would like to go one step further in order to make my component as compatible with existing HTML controls as possible.
With standard HTML controls we can do this: myTextField.disabled = true; and as soon as this property is set, I assume there is a property listener of some kind that is invoked to change the appearance and value etc of the control.
I want to write my own 'property listener' to do this with my control. Can I do it in Javascript or is this too "low level", requiring code at the browser implementation level?