JavaScript - Desperate Help Enabling Disabled Button In Slideshow
i have this slideshow, Swiss Army Image slideshow i got from DDrive. it has forward and back buttons that are disabled unless the Play/Stop button is in Stop mode. i cannot for the life of me figure out how to enable the buttons always. please can someone help? i have a maniac client who's now threatening not to pay because of this one thing!!!
installation: http://cssphpmysql.com/dev/westermancm/library2.html js: http://cssphpmysql.com/dev/westermancm/js/swissarmy.js thanks so much! GN Similar TutorialsHi there, This is my request. I don't know if it CAN be done via JS, but it just seemed likely it could: Basically, I have a table echoed out by PHP: PHP Code: while($row = mysql_fetch_array($result)){ echo "<tr>"; echo "<td>".$row['Name']."</td>"; echo "<td>".$row['gig_count']."</td>"; echo "<td>" .$row['dob']."</td>"; echo "<td>".$row['Mail']."</td>"; echo "<td><a href=\"/records/add_gigs.php?id=".$row['Member_ID']."&?name=".$row['Name']."\"><button class=\"submit\">Add new Gig</button></a></td>"; echo "<td><a href=\"/certsend.php?name=".$row['Name']."&?mail=".$row['Mail']."\"><button class=\"submit\">Make Certificate!</button></a></td>"; echo "</tr>"; And if the value of gig_count is less than 20, then the 'make certificate' button will be disabled. Once gig_count is 20 or more, then it is re-enabled for that particular row. Any code towards this is greatly appreciated. Hi, I'm writing an android application to login into a website by injecting javascript into the HTML. So far it works for inputting the username and password, but I can't enable the submit button. Here is my code Code: "javascript: document.getElementById('user').value = '"+username+"'; document.getElementById('pass').value = '"+password+"'; document.getElementsById('submit').disabled = false;" Here is the code from the website concerning the submission form. Does anybody have any idea why this isn't working? Thank you for any help! Code: <form id="loginForm" name="query" method="post" action="/login/" enctype="application/x-www-form-urlencoded" autocomplete="off"> <p> <input type="hidden" name="one" value="wiscmail.wisc.edu" /> <input type="hidden" name="two" value="WiscMail Login" /> <input type="hidden" name="creds_from_greq" value="1" /> <input type="hidden" name="three" value="1" /> <input type="hidden" name="four" value="a5" /> <input type="hidden" name="five" value="GET" /> <input type="hidden" name="six" value="wiscmail.wisc.edu" /> <input type="hidden" name="seven" value="L2xvZ2lu" /> <input type="hidden" name="relay_url" value="https://wiscmail.wisc.edu/PubCookie.reply" /> <input type="hidden" name="eight" value="YXBwdXJsPXdpc2NtYWlsLndpc2MuZWR1L2xvZ2lu" /> <input type="hidden" name="fr" value="NFR" /> <input type="hidden" name="hostname" value="wiscmail.wisc.edu" /> <input type="hidden" name="nine" value="1" /> <input type="hidden" name="file" value="" /> <input type="hidden" name="flag" value="0" /> <input type="hidden" name="referer" value="(null)" /> <input type="hidden" name="post_stuff" value="" /> <input type="hidden" name="sess_re" value="0" /> <input type="hidden" name="pre_sess_tok" value="1714500944" /> <input type="hidden" name="first_kiss" value="1320154779-954466" /> <input type="hidden" name="pinit" value="0" /> <input type="hidden" name="reply" value="1" /> <input type="hidden" name="create_ts" value="1320154779" /> <label for="user">NetID</label><input type="text" id="user" name="user" size="20" tabindex="1" value="" /> </p> <p class="info"><a tabindex="4" href="/redirect/help-whatisit">What is my NetID?</a> (ie. bbadger)</p> <p><label for="pass">Password</label><input type="password" id="pass" name="pass" tabindex="2" maxlength="36" value="" /> </p> <p class="info"><a tabindex="5" href="/redirect/mynetid-reset">Forgot your password?</a></p> <p><label for="submit" class="invisible">Submit</label><input tabindex="3" class="submitButton" type="submit" id="submit" value="Login" /></p> </form> hi.. i have a jsp page in which there is a table. the number of rows is variable and depends on a pre-defined query. every row has 2 editable textboxes which are initially disabled. i need to activate these textboxes according to the radio button which corresponds to the particular row in question. can anybody pls tell me how to do that. the code that i have written is as follows.if there is any tweaking to be done pls suggest the same. code: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@page import="java.util.ArrayList" %> <%@page import="DTO.UserGroupDTO"%> <html> <head> <script type="text/javascript">} funtion enable(){ document.getElementById("inp1").disabled=false; document.getElementById("inp2").disabled=false; } function disable(){ document.getElementById("inp1").disabled=true; document.getElementById("inp2").disabled=true; } </script> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Update User Group Inquiry Results</title> </head> <body bgcolor="#aabbcc"> <center> <h3>Update User Group Inquiry Results</h3><br><br> <%ArrayList arrayList=(ArrayList)request.getAttribute("myList"); ArrayList list; int size=arrayList.size(); Integer groupId=null; String userGroupName=null; String description=null; %> <form action="/test/BankServlet"> <table style="color: highlight" border="5"> <% if(!(arrayList.isEmpty())){%> <tr><th>Group ID</th><th>User Group Name</th><th>Description</th><th>Selection</th></tr> <% for(int i=0;i<size;i++){ UserGroupDTO userGroupDTO=(UserGroupDTO)arrayList.get(i); userGroupName=userGroupDTO.getUserGroupName(); groupId=userGroupDTO.getGroupId(); description=userGroupDTO.getDescription(); %> <tr> <td><%out.println(groupId); %></td> <td><input id="inp1" disabled="disabled" value="<% out.println(userGroupName); %>"></td> <td><input id="inp2" disabled="disabled" value="<%out.println(description); %>"> </td> <td> <input type="radio" name="radio2" value="<%=groupId %>" onclick="enable()"> </td> </tr> <% } } else{ out.println("No match found"); } %> <tr> <td><input type="hidden" name="strTitle" value="UpdateUserGroup"></td> </tr> <tr> <td><input type="hidden" name="value" value="<%=groupId%>"></td> </tr> </table><br> <input type="submit" value="Update User Group" style="background-color: gray"> </form> <form action="/test/jsp/UserGroup.jsp"> <input type="submit" value="Go Back to User Group Operations Page" style="background-color: gray"> </form> <br><br><br><br> </center> </body> </html> I have a form that disables the radio options after choosing one and pressing a confirm selection button. Does the disabled attribute affect the value submitted? Hello, I have a script that enables a certain button when some conditions are met. I'm having an issue with it, so I made a simple script to get to the core of what I'm trying to do. This is the script that I'm using: Code: function disable() { document.form.button2.disabled='false'; } Code: <form name="form"> <input type="button" name="button1" value="Enable Button 2" onclick="disable()" /> <input type="button" name="button2" value="Button 2" disabled="true" /></form> Basically when you press button 1, button 2 enables. If I reverse it (button 2 enabled by default, pressing button 1 enables it) it is fine. But for some reason this way round nothing happens when I press button 1. What am I doing wrong? Good day all, I was hoping someone could help me out with the following. I currently have a slideshow that as thumbnails under a main image. The thumbnails slide left and right with hover on a button and with a click changes main image without any problems. Few things I am looking to change/add: 1. The ability to mouse over the main image and have the caption appear than disappear when the mouse is moved off. Currently I have the caption as a static text under the main image. 2. Start the thumbnail position in the middle instead of the left 3. Add mouseover buttons to the main image to give the ability to cycle through the images instead of having to always use the thumbnails. Below I've include the Javascript code: Is this the best way or is there a better way? Example of slideshow: http://neileverosborne.com/portfolios/manatees.html JAVASCRIPT: Code: var displayWaitMessage=true; // Display a please wait message while images are loading? var activeImage = false; var imageGalleryLeftPos = false; var imageGalleryWidth = false; var imageGalleryObj = false; var maxGalleryXPos = false; var slideSpeed = 0; var imageGalleryCaptions = new Array(); function startSlide(e) { if(document.all)e = event; var id = this.id; if(this.id=='arrow_right'){ slideSpeedMultiply = Math.floor((e.clientX - this.offsetLeft) / 5); slideSpeed = -1*slideSpeedMultiply; slideSpeed = Math.max(-10,slideSpeed); }else{ slideSpeedMultiply = 10 - Math.floor((e.clientX - this.offsetLeft) / 5); slideSpeed = 1*slideSpeedMultiply; slideSpeed = Math.min(10,slideSpeed); if(slideSpeed<0)slideSpeed=10; } } function releaseSlide() { var id = this.id; slideSpeed=0; } function gallerySlide() { if(slideSpeed!=0){ var leftPos = imageGalleryObj.offsetLeft; leftPos = leftPos/1 + slideSpeed; if(leftPos>maxGalleryXPos){ leftPos = maxGalleryXPos; slideSpeed = 0; } if(leftPos<minGalleryXPos){ leftPos = minGalleryXPos; slideSpeed=0; } imageGalleryObj.style.left = leftPos + 'px'; } setTimeout('gallerySlide()',20); } function showImage() { if(activeImage){ activeImage.style.filter = 'alpha(opacity=50)'; activeImage.style.opacity = 0.5; } this.style.filter = 'alpha(opacity=100)'; this.style.opacity = 1; activeImage = this; } function initSlideShow() { document.getElementById('arrow_left').onmousemove = startSlide; document.getElementById('arrow_left').onmouseout = releaseSlide; document.getElementById('arrow_right').onmousemove = startSlide; document.getElementById('arrow_right').onmouseout = releaseSlide; imageGalleryObj = document.getElementById('theImages'); imageGalleryLeftPos = imageGalleryObj.offsetLeft; var galleryContainer = document.getElementById('galleryContainer'); imageGalleryWidth = galleryContainer.offsetWidth - 20; maxGalleryXPos = imageGalleryObj.offsetLeft; minGalleryXPos = imageGalleryWidth - document.getElementById('slideEnd').offsetLeft; if (navigator.userAgent.indexOf('MSIE') >= 0) { var arrowWidth = document.getElementById('arrow_left').offsetWidth; var el = document.createElement('div'); el.style.position = 'absolute'; el.style.left = arrowWidth + 'px'; el.style.width = (galleryContainer.offsetWidth - arrowWidth * 2) + 'px'; el.style.overflow = 'hidden'; el.style.height = '100%'; document.getElementById('galleryContainer').appendChild(el); el.appendChild(document.getElementById('theImages')); } var slideshowImages = imageGalleryObj.getElementsByTagName('IMG'); for(var no=0;no<slideshowImages.length;no++){ slideshowImages[no].onmouseover = showImage; } var divs = imageGalleryObj.getElementsByTagName('DIV'); for(var no=0;no<divs.length;no++){ if(divs[no].className=='imageCaption')imageGalleryCaptions[imageGalleryCaptions.length] = divs[no].innerHTML; } gallerySlide(); } function showPreview(imagePath,imageIndex){ var subImages = document.getElementById('previewPane').getElementsByTagName('IMG'); if(subImages.length==0){ var img = document.createElement('IMG'); document.getElementById('previewPane').appendChild(img); }else img = subImages[0]; if(displayWaitMessage){ document.getElementById('waitMessage').style.display='inline'; } document.getElementById('largeImageCaption').style.display='none'; img.onload = function() { hideWaitMessageAndShowCaption(imageIndex-1); }; img.src = imagePath; } function hideWaitMessageAndShowCaption(imageIndex) { document.getElementById('waitMessage').style.display='none'; document.getElementById('largeImageCaption').innerHTML = imageGalleryCaptions[imageIndex]; document.getElementById('largeImageCaption').style.display='block'; } window.onload = initSlideShow; Dear Experts Whenever I use Javascript in my web and run it into Internet Explorer then it displays following messagebar To help protect your security, Internet Explorer has restricted this file from showing active content that could access your computer... If I do not allow blocked contents then nothing is displayed. My question is how to enable blocked contents through codes in html page. If it is not possible then why should we us javascript. Please help me to remove this confusion. I have an e-script that agents use on a daily basis as their script. I have a page, that when a yes or no answer is given, it enables AND disables buttons accordingly. I am having some issues with the code. In this example, the agent must ask if the customer has insurance. They must select yes or no, from the radio buttons. If yes is selected, all buttons need to activate, or ungray. If they select no, I need the buttons to gray out. This needs to function both ways, meaning, if they first choose yes, the buttons light up. But, if they customer wasn't sure, and they in fact do not have insurance, and the agent clicks the no button, it then needs to gray the buttons out again. I have the first part of this code working, I am able to enable the buttons when clicking yes. However, I cannot get it to work reverse, when I click the no button. They stay enabled. Here is my current DF coding. Thanks in advance!!! I am stuck! Code: <script type="text/javascript"> window.onload=function() { df=document.forms[0]; df[1].disabled=true; df[0].onclick=function(){ df[1].disabled=(df[1].disabled)?false:true; } df=document.forms[0]; df[4].disabled=true; df[1].onclick=function(){ df[4].disabled=(df[4].disabled)?false:true; } df=document.forms[0]; df[5].disabled=true; df[4].onclick=function(){ df[5].disabled=(df[5].disabled)?false:true; } df=document.forms[0]; df[6].disabled=true; df[5].onclick=function(){ df[6].disabled=(df[6].disabled)?false:true; } df=document.forms[0]; df[9].disabled=true; df[6].onclick=function(){ df[9].disabled=(df[9].disabled)?false:true; } df=document.forms[0]; df[10].disabled=true; df[9].onclick=function(){ df[10].disabled=(df[10].disabled)?false:true; } df=document.forms[0]; df[12].disabled=true; df[10].onclick=function(){ df[12].disabled=(df[12].disabled)?false:true; } df=document.forms[0]; df[15].disabled=true; df[12].onclick=function(){ df[15].disabled=(df[15].disabled)?false:true; } df=document.forms[0]; df[18].disabled=true; df[17].onclick=function(){ df[18].disabled=(df[18].disabled)?false:true; } df = document.forms[0]; df[2].onclick = function() { df[17].disabled = !df[17].disabled; df[18].disabled = !df[18].disabled; df[19].disabled = !df[19].disabled; df[20].disabled = !df[20].disabled; } df[17].disabled = true; df[18].disabled = true; df[19].disabled = true; df[20].disabled = true; } df = document.forms[0]; df[3].onclick = function() { df[17].disabled = !df[17].disabled; df[18].disabled = !df[18].disabled; df[19].disabled = !df[19].disabled; df[20].disabled = !df[20].disabled; } df[17].disabled = true; df[18].disabled = true; df[19].disabled = true; df[20].disabled = true; </script> The buttons are DF's 17,18,19 & 20. When DF 2 is selected, I need them to enable. When DF 3 is selected, I need them to disable. I have more than just those I need to fix, but if I can get that one working, I can take it from there. Thanks! Hi everybody... I have some radio group boxes and according to select one of the values, the other values in another radio boxes should be enabled and checked. In the onClick method of each radiobox i call a setDefault() function to reset the value of radioboxes.... (e.g for (i;i<document.NPOrder.pSubstrate.length;i++){ document.NPOrder.pSubstrate[i].disabled=false; document.NPOrder.pSubstrate[i].checked=false; } and after that i disabled and checked the other's value...) Problem: The code in setDefault() doesn't work properly and after disabling the radios, i can't enable them again Please help me and thanks in advance... Hany Ooops!
(edit) i've fixed it. thanks
Hey guys, i'm taking on my first minor project in javascript and i've run into an error. For whatever reason, buttons i've defined are calling on functions that supposedly don't exist, yet they are clearly in the code and can be applied anywhere. I also checked the syntax errors in google chrome and they state: Uncaught SyntaxError: Unexpected token else Uncaught reference error: go() is not defined Uncaught reference error: highscore() is not defined. So without further delay, here is the full code. Can anyone help me out? Code: <html> <head> <script type="text/JavaScript"> <!-- var sam = 9; var sally = 8; var donald = 4; function percentage (score) { return score / 10 * 100; }; function go() { document.write("Sam's score on the test is " + percentage(sam) + "%, <br \> Sally's score on the test is " + percentage(sally) + "%, <br \> Donald's score on the test is " + percentage(donald) + "%"); }; function highscore() { if (Math.max(90, 80, 40) === 90){ document.write("Sam's score was the highest.")}; else if (Math.max(90, 80, 40) === 80){ document.write("Sally's score was the highest.")}; else{ document.write("Donald's score was the highest.")} }; //--> </script> </head> <body> <input type="button" onclick="go()" value="Student Grades"> <br \> <input type="button" onclick="highscore()" value="Highest Score"> </body> </html> hi, my problem is that .disabled only work in Firefox. How do i make it work in other browses? Below is the code i attached Code: if (output=="Available") document.register.submitBtn.disabled=false; else document.register.submitBtn.disabled=true; I've used js only for simple form validations thus far. I've been working on a coldfusion/ajax dynamic select list for a few days and just about have it functioning the way I want it. My question is this. Whats the best way, if any, to handle users who turn js off. What I mean is, I have so far three separate queries for my three select lists, and are populated with ajax calls. Is there a way to get the same functionality with standard queries and page refreshes in case a visitor does have js disabled? Thanks for any tips and advice. Hello, I'd like to use the following code on my website: <script type="text/javascript"> if(screen.width==1024) { document.write("<link rel='stylesheet' type='text/css' href='style1024.css' />"); } else { document.write("<link rel='stylesheet' type='text/css' href='style.css' />"); } </script> This inserts a different css file when the screen width is 1024, as you can see, BUT the problem is, that this way if someone has js disabled, he sees the page with no css, which would be very bad. So my question would be: Is there a way to set that my website checks if javascript is enabled or not and if not, it sets the normal css somehow? Thanks for your help. i have an assignment to solve in which i have given two checkboxes one is enabled and another one is disabled n m required that if we select enable checkbox the disabled checkbox may also be selected automatically can any one help out for its coding please Thanks Hi! I have two input fields from who one of them i to upload image and other text field to upload image from url .I want to disable one of this fileds and to stay only one .For js code is helping me one friend but him help was enough and the code have some bugs,like fist fileds as active and them when check one has disable and opposite.I want this nly one field to be disable when the page is load but when checkbox is clicked .Sorry for my english .I hope you understand me. Code: <script type="text/javascript"> window.onload = function(){ var check = document.getElementById('check1'); var file = document.getElementById('file'); var text = document.getElementById('text'); check . onchange = function(){ if( check.checked ){ text.setAttribute('disabled', 'disabled'); file.removeAttribute('disabled'); } else{ text.removeAttribute('disabled'); file.setAttribute('disabled', 'disabled'); } }; }; </script> <input id="check1" type="checkbox" name="check" /> From link!!!<br/> Poster:<input id="file" type="file" name="poster" /> Poster from link:<input id="text" type="text" name="postlink" /><br/> |