Actually, the subject pretty much is the question, but if you want more detail, here goes code...
pans and zooms the map when the user selects a line, which is really useful about 95% of the time and kind of annoying 5% of the time. So I was thinking it would be good to give them the option of disabling that function for the 5%.
the function gets called from a couple of different places in the code, so for neatness' sakes it would be nice to have something within the function above that checks for the checkbox state before executing. but some kind of if/else where the function gets called would be ok, too..
Say there are two checkboxes on a page (test1 and test2), I want to write a JavaScript code that disables one if the other is checked. Here's what I wrote that didn't work code...
However when submitting the form values in email, the value of the checkbox won't submit with the checkbox value being disabled (if I comment out that second line, it works). Of course, I don't want the value able to be unselected.
I have a checkbox at the top of the page, and then I have a form full of text fields etc, called 'frmEnquiry'.
I would like the form to be disabled (or the text fields, elements etc) when the checkbox is not enabled, and when ticked i would like it to be enabled.
Code JavaScript: <script language=javascript> function apply() { document.frm.sub.disabled=true;
[Code].....
Im using the above code. if, change this code for array of checks box not working. If i change above html code like below , Then how to change javascript?
I have a form with some text fields that are disabled UNLESS a checkbox is checked. Initially the text fields are disabled and the checkbox is unchecked.
The code is something like this:
Code: function disableTextbox() { if (chk.checked) { txt.disabled = false; } else { txt.disabled = true; } }
<form action=something.cfm> <input type=checkbox name=chk onclick=disableTextbox();> <input type=text name=txt disabled> <input type=submit> </form> When the form is submitted, some validation is performed. If anything fails, I display an error message and show a link to go back (history.back).
The problem that I am having is that when you click on the link to go back, the checkbox on the form is checked, but the text fields are disabled.
You have to re-click the checkbox to update the text field.
I have an accordion pane with each pane containing checkboxes and a button. How do I disable the buttons on all the accordion panes until the users checks at least one checkbox?
I have multiple forms on my website. Some of them have a checkbox which is checked by default, whereas others are unchecked by default. I'm trying to figure out how I would detect whether or not the checkbox is checked, and if it is checked, disable certain fields (not necessarily all fields), and then toggle it back and forth as I check or uncheck the box..I found this code:
Firebug returns an error saying msg.elements is undefined. I'm trying to make a function that will enabled a delete button if any of the check boxes in a list are checked.
Code:
function selectone () { var msg = document.getElementsByName('pm'); var i = 0; for(i; i < msg.elements.length; i++)
I have a gridview with a checkbox (CheckBoxActiveClient) in the first column and a textbox (Copies) in the 5th column. I want that row's textbox (Copies ) to be disabled if the checkbox is unchecked in that row. I wrote a javascript function for this but it doesn't work.
Code: <script type="text/javascript"> function EnableTextBox()
I want to disable a function when a user is pressing control or command using Javascript. Is this at all possible? My reason for doing this is because I recently implemented lightbox to my script, but I still want users to be able to open the image in a new tab by just clicking control or command when clicking the image rather than opening it in lightbox (which it does).
I am trying to figure out how to pass the value of an item from my HTML form through Javascript/Ajax.
Here is the code:
This is what I have in my showRSS function:
This does not seem to be working, is there something I have missed here to that the value in my checkbox input would be passed through the showRSS function?
I've tried Googling this, but haven't found anything, yet.If I have an array of checkboxes, and each checkbox calls the same function with onClick, is there a way to indicate to the function which checkbox within the array called the function?
How would I go about making a function on a checkbox that pops up one alert menu when its checked and pops a different alert when its unchecked? Here's what I have so far I know its wrong I don't know how to change the beginning.
Code: function compare(bing){ if ("bing"=checked){ alert("You agree, your favorite search engine is also bing."); }else{ alert("you disagree, your favorite search engine is not bing."); }}
I have an image map with various areas on it. A user can click on the various areas and something happens. That said, I sometimes need to disable the ability to click on some areas. For instance areas whose id attribute contains 0 0. I have the code to split the id and grab whether the values are 0 or 1 and the alert pops up when one has 0 0 in the id but it's still clickable. I thought .unbind would do the trick, but it isn't. The alert is simply for testing.
$('area').each(function(){ // Use the each() method to gain access to each elements id var idToDisable = $(this).attr("id");//get id of area var splitID = idToDisable.split("_"); if (splitID[3] == 0 && splitID[5] == 0){ alert(splitID[3]+splitID[5]); $(this).unbind('click'); }else{ }});
see there is a featured section with 3 images on the homepage ... there's a left image, center image and right image ... when you hover your mouse over the left or right picture, an arrow and a white overlay shows up so you're able to switch the images ... i'd like to take away the hover and instead make that arrow and white overlay permanent. This means that once the website is loaded, the arrow and white overlay is already there without having to hover the mouse pointer over the image ... here are the specific codes that controls the animation ....
jQuery('.next-block a').live('click',function(event){ event.preventDefault(); if (!et_animation_running) rotate_slide('next');
Im creating a task loggin system and this allows the user to raise tasks and update them, im using javascript for validation and if the fields are empty it then changes the fields back ground to Red which is fine but then it goes on to update the data in SQL which i dont want, any suggestions or how i can achieve no post back is the result from the function is False (for fields in error)Html Code where im calling the function