473,396 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

javascript hide button

hi,
i want to enable/disable a button when an item in the listbox control is selected.can i get a function on this
Mar 27 '08 #1
2 1348
kunal pawar
297 100+
Using javascript

document.getElementById(Button Id).disabled = false;

and if ur button is server control then
button1.enabled = true
Mar 28 '08 #2
malav123
217 100+
HI,
Use the function given below in java script it will works for u...
function MoveItem(lstassociatedstate, lstavailablestate,f,v)
{
var hid;
var id=v;
hid = '';
if(id=="ctl00_ContentPlaceHolder1_TabAddCompany_Ta bPanel1_btnnextone")
{

if ((lstavailablestate != null) && (lstassociatedstate != null))
{
if(lstavailablestate.length < 1)
{
alert('There are no items in the source ListBox');
return false;
}
if(lstavailablestate.options.selectedIndex == -1) // when no Item is selected the index will be -1
{
alert('Please select an Item to move');
return false;
}

while ( lstavailablestate.options.selectedIndex >= 0 ) {
var newOption = new Option(); // Create a new instance of ListItem
newOption.text = lstavailablestate.options[lstavailablestate.options.selectedIndex].text;
newOption.value = lstavailablestate.options[lstavailablestate.options.selectedIndex].value;

lstassociatedstate.options[lstassociatedstate.length] = newOption; //Append the item in Target
hid = hid + lstavailablestate.options[lstavailablestate.options.selectedIndex].value + ",";
lstavailablestate.remove(lstavailablestate.options .selectedIndex); //Remove the item from Source
}
}
}
}
Mar 28 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: SpamProof | last post by:
I need to set my div tag (<div id="divBioBottom"> content </div>) to either visible or hidden from javascript. Does anyone know how to do this? Thanks. 7078895 /ra
1
by: Oliver Hoehle | last post by:
Hello! This ist the source-code for an editable combobox implemented with HTML,CSS and Javascript. I have tested it with IE and Mozilla. But I don't know, if it will work in other browsers...
1
by: Anna | last post by:
Hi, I have disabled a checkbox and a the lable for that (text in a <td>) <td class="label" width="90" id="recalc" disabled>Recalculate price</td> <td><input type="checkbox" name="cbRecalc"...
5
by: googlegroups | last post by:
I have a large table in html created dynamically. This table can grow to several hundred rows or more. I have the ability to hide or display individual rows (using row.style.display = "none") and...
5
by: Ben | last post by:
I have a form for data entry which is in a table. I have a select box to enter a customer name, which takes it's options from the customer database. I have a button to add a new customer. What I...
4
by: James | last post by:
Hello group: I'm trying to hide a panel control in javascript when a print button is clicked. On my web form, I have a button that fires a javascript function called doPrint(). No matter how I...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
3
by: Bubu | last post by:
It's possible to hide or show e div from a iFrame page with javascript? If yes, please can anyone tell me how to do this? Thanks Bubu
2
by: joelkeepup | last post by:
Hi, I made a change this morning and now im getting an error that says either "a is undefined or null" or "e is undefined or null" the microsoft ajax line is below, I have no idea how to...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.