List Indexes - Short Function Without Options?
Jan 21, 2010
I have 2 lists and function to clean them
function del_sel(option){
if (option == "1"){
document.forms[0].list1.innerHTML = '';
}if (option == "2"){
document.forms[0].list2.innerHTML = '';
}}
How to make this function shorter & without options? Something like that:
function del_sel(option){
document.forms[0].option.innerHTML = '';
}
The problem is that this code returns mistake:
function del_sel(option){
document.forms[0].option.innerHTML = '';
}
...
<input type='button' value='Delete onclick='del_sel(form.list1);>
View 2 Replies
ADVERTISEMENT
Apr 11, 2009
Looking at the sample code below, if you click the same link over and over, I get the desired result / animation of the revealed div. If however you click 'link 2' then any link except 'link 2' the animation is different. What do I need to change in my logic to always get the desired result despite which link was clicked?
[Code]...
View 2 Replies
View Related
Aug 4, 2006
I have a multiple select list that is created dynamically based on a previous selection on an asp page. The first thing I do is to clear the curent option list by
document.form1.itemcross.length = 0;
The only problem is that it leaves the optgroups. How do I also get rid of the optgroups?
View 16 Replies
View Related
May 21, 2009
I have two select lists, the first one has three options in it, What I need to have happen is once a option is selected in the first drop down, the second drop down will be populated with the remaining two options.
View 2 Replies
View Related
Jul 5, 2011
The following PHP code populates a dropdown list of Projects. I would like to be able to click on a Project Name in the list and have its corresponding list of Characters appear beside it. How can I tie jquery into this as it's running? All the jquery examples I see are for hard coded HTML data instead of a PHP loop grabbing from a database.
Code:
//creates the Project dropdown list
while ($proj = mysql_fetch_array($project)){
$id_proj = $proj['projid'];
$name_proj = htmlspecialchars($proj['projectName']);
[Code]....
I don't care if it's a clickable list of anchors instead of a dropdown. Also, I don't care whether people have javascript enabled as this is for my personal use.
View 6 Replies
View Related
Mar 26, 2011
Resolution:
<script type="text/javascript">
I have an array in a seperate.js file that I need to step through a FOR loop to grab all these values and add them together.
Here is a small sample of the array's:
Here is the loop step through that I have:
I am stuck on how to grab each amount index and add them together to save them as the amountTotal variable.
View 1 Replies
View Related
Oct 1, 2011
I have this sort of image gallery where you can drag and drop images around. CLients should be able to do this in order to determine the order in which images are shown on their website. All images have a unique id and a order number. It is my first time I use jquery, the sortable part was easy to find out but then what happens? I have to find out how to get the 'new order' and how to store it in database. I am using ColdFusion. My idea, either I store the new order each time one moves an image around either I let them move like they want to and ask them to click a button to confirm. The structure of the document is a <ul id=sortable> then each image is <li>.
View 1 Replies
View Related
Apr 26, 2011
Basically i have two arrays one contains Services and the other contains prices
ie
Code:
At the moment there are 7 elements in this i have this printing to a dropdown with
Though i want to print the price to a textbox ie if element [0] in service is selected return price [0] though i want to iterate through the positions then display the value in a read only textbox.
View 1 Replies
View Related
Sep 20, 2010
Code:
<select name="bedroom[]" size=4 multiple> <option value="">Select Bedroom type</option> <option value="0">ALL</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> </select>
If "ALL" is selected user should not select other options. Other wise he should be able to select multiple selections like 2,3,4,5 etc.
View 1 Replies
View Related
Jul 21, 2011
I'm using dreamweaver cs5 and I have created a page that have a table that can check or uncheck certain option in each row..in every column, there is a main button ('m planning to add function in the main button to be check all or uncheck all - but I did not managed to do it right...there are errors)
For example:
Pulau Pinang button, when user click, it will check/uncheck all option under Pulau Pinang...same goes to other columns. After selecting their option, user can submit their option using submit button (option chosen can be in different columns). My problem is, my submit and reset button is not functioning besides, I'm not able to make the main button to check or uncheck all option..
Below is my coding for reference:
PHP Code:
<!DOCTYPE ...> <html ...> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title> <style type="text/css"> body {
background-image: url(images/crop.jpg); margin-left: 130px; margin-top: 60px;
margin-right: 130px; margin-bottom: 100px; background-color: #FFF;
} body,td,th { font-size: 14px; color: #000; } </style> <script type="text/javascript"> function MM_swapImgRestore() {
//v3.0 var i,x,a=document.MM_sr; .....
I've tried also using below code for check all/uncheck button but it doesn't work:
PHP Code:
<form name="myform" action="checkboxes.asp" method="post">
<input type="checkbox" name="check_list" value="1">ASP<br>
<input type="checkbox" name="check_list" value="2">PHP<br>
<input type="checkbox" name="check_list" value="3">JavaScript<br>
<input type="checkbox" name="check_list" value="4">HTML<br>
<input type="checkbox" name="check_list" value="5">MySQL<br>
<input type="button" name="Check_All" value="Check All" onClick="CheckAll(document.myform.check_list)">
<input type="button" name="Un_CheckAll" value="Uncheck All" onClick="UnCheckAll(document.myform.check_list)">
View 3 Replies
View Related
Jan 30, 2010
I want to add more dropdown options which are dependent on previous options. Now I have "hand" and "loft". I want to add next option "model" How to add third dropdown option box?
Here is the code:
View 3 Replies
View Related
Dec 22, 2005
I want to show some message in a box when the mouse is over a button (examples: undo, save, open, ecc ) like in some interface. I don't want to display the mesage in an alert window.
View 4 Replies
View Related
Mar 15, 2007
What the short way of using an if statment for assigning values to a verible?
View 2 Replies
View Related
Apr 9, 2010
I've been tasked with fixing a problem on a site that I didn't develop, but in a nutshell somebody wrote a little Javascript that appears to only be working in IE. I'm not sure why...would anybody be kind enough to have a quick look?Page in question is: http://www.thomastonauction.com/newA...eSignature.phpThe script not working is in the head of that page, and looks like this:Code:<!--this appears to be the script that is called when users click the "submit to thomaston auction" button,which should trigger an email containing the bid info. to "auction@kajav.com" and open a printable copy of the bid in a new window ("newAbsenteePrintForm.php")-->
<script language="JavaScript" type="text/JavaScript">
function openPrintForm(sid)
{
[code]....
View 8 Replies
View Related
Sep 4, 2009
I am using a simple javascript slide show. The actual width of it is fine, but the scrolling part is messed up, it's suppose to start at the very right and scroll all the way left. Instead it scrolls in like a 150px area and repeats. How can I get the picture to scroll the entire length?[code]...
View 2 Replies
View Related
Apr 7, 2011
I am coding a page that has 6 buttons on it, from which one is the correct button (the target). I want to try and implement the following:
1) when a wrong button is clicked, the file "wrong.mp3" is played. It is less than a second long.
2) when the correct button is click, the file "right.mp3" is played. It too is less than a second long. The page then redirects/reloads. This is the code that I can't seem to get to work:
[Code]...
View 4 Replies
View Related
Dec 8, 2010
I need help with a code that will generate a random number or integer (from 1-9). Does anybody know of a short random generator without having to import anything?
View 1 Replies
View Related
Sep 1, 2009
I am using the following jquery plugin:Besides the link to the relevant JS I have this piece of code in my page <head> </head> section:
<script type="text/javascript">
$().ready(function() {
function findValueCallback(event, data, formatted) {
[code]....
View 2 Replies
View Related
Sep 1, 2009
I've got this lovely little animation that slides some div fields to the right a short distance. Everything works except the setTimeout (located in the SlideIn function). It simply 'jumps' without taking any time at all. I've tried a bunch of stuff:
changed the amount of time from 100 to 10000
changed it from var t = setTimeout("SlideIn()", 1000)
SlideIn with/without the brackets, with/without the quotation marks.
[code]....
View 7 Replies
View Related
Jun 10, 2010
I need a program by which I want to open several web link autometically after a short interval. E.g. open google.com, then wait for 10 sec, then open yahoo in the same window, then wait for 10 sec, then open gmail, wait for 10 sec, then myspace, and so on.......
View 2 Replies
View Related
Mar 16, 2009
Not sure if the root problem is a js load issue or rather css. Problem page is here: [URL] I've had success using the Lightbox2 module on several Drupal-based sites, but this is the first time I've handled the straight code and tried to drop it into a hand-coded site. Internet Explorer fails to draw the overlay div to the full page height. Firefox 3 performs as expected.
The web site suggests setting the body margin and padding to zero, but those were set anyway and tweaking didn't help. Another suggestion was to stick initLighbox() into the body onload, but that function doesn't exist. Also tried initialize() and Lightbox.initialize(), but again it's claimed those functions don't exist. Looking into the code, however, initialize() is where the div height is calculated, I think. It should be noted that the lightbox still works on IE even when using one of these failed onload attempts. And I don't actually get IE to report any js error with the onloads - I have to rely on Firebug for that.
View 4 Replies
View Related
Aug 16, 2010
i m trying to append months short type with jQuery Datepicker
Code JavaScript:
<script type="text/javascript">
$(function() {
[code]...
View 20 Replies
View Related
Jul 11, 2010
I've been using this little bit of code to show a div when the user rolls over a link:
$('a#eventspopupbtn').mouseover(function() {$('#menu').hide('fast'); $('#eventspopup').show('fast');
return false;
});
I have been trying to extend this bit of code so that there is a short delay built inso that if the user rolls over the link by mistake or 'just passing through' the div is not displayed. I tried using setTimeout but couldn't get that working (unfortunately, I can't share that with you because I lost the code).
View 3 Replies
View Related
Dec 20, 2010
the person whose site this is wants a short blip sound played whenever you roll over the links in the sidebar. I know it's not advised, but she insists. I've tried implementing a few scripts but no luck in Firefox or Chrome.
View 2 Replies
View Related
Jan 5, 2012
Working on creating my own plugin and realized that I would very likely end up doing this again in the future. Unfortunately, I have an extremely short memory when writing code. I frequently have to re-read the code I've created the day prior so I can get back on track with what I was doing. As such, I'm a fervent commenter in my code.
So, I'm creating a jQuery plugin framework with comments for everything that's going on in the framework to prevent my brain from having to re-learn everything in a month or so when I do another one.
Plugin-savvy folks to take a look at this code and help me fill in the blanks and make corrections to those places where I'm way off base. As you'll likely notice rather quickly, this is taken from the jQuery plugin tooltip construct found here: [url]
View 2 Replies
View Related
Jul 20, 2005
Where can I download a complete javascript function list?
View 2 Replies
View Related