473,386 Members | 1,674 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,386 software developers and data experts.

Display/hide button

Hi,

I want to display or hide the button.

Condition is
1. During Onload, "Update" button is Hide.
2. the drop down list must be selected, meaning SelectedIndex != 0
3. all 5 input text edit box must have value in it.

After the condition 2 and 3 are fulfilled, the Update Button will appear.

How to achieve that in javascript ? please help.
Mar 14 '07 #1
2 22234
magix wrote on 14 mrt 2007 in comp.lang.javascript:
Hi,

I want to display or hide the button.

Condition is
1. During Onload, "Update" button is Hide.
2. the drop down list must be selected, meaning SelectedIndex != 0
3. all 5 input text edit box must have value in it.

After the condition 2 and 3 are fulfilled, the Update Button will appear.

How to achieve that in javascript ? please help.
<button style='display:none;' id='b'....

if (allIsWell)
document.getElementById('b').style.display = 'block';

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 14 '07 #2
On Mar 14, 12:08 pm, "Evertjan." <exjxw.hannivo...@interxnl.net>
wrote:
magix wrote on 14 mrt 2007 in comp.lang.javascript:
Hi,
I want to display or hide the button.
Condition is
1. During Onload, "Update" button is Hide.
2. the drop down list must be selected, meaning SelectedIndex != 0
3. all 5 input text edit box must have value in it.
After the condition 2 and 3 are fulfilled, the Update Button will appear.
How to achieve that in javascript ? please help.

<button style='display:none;' id='b'....

if (allIsWell)
document.getElementById('b').style.display = 'block';

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Where function allIsWell might look something like:

function allIsWell() {
return (document.getElementById('mySelect').selectedIndex >= 0 &&
document.getElementById('myText1').value &&
document.getElementById('myText2').value &&
document.getElementById('myText3').value &&
document.getElementById('myText4').value &&
document.getElementById('myText5').value);
}

Replace with your actual element id's of course...

Mar 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: FrankBooth | last post by:
Hello, I have a list of names, and when I click ona name I want the extar info to show and then I want to clcik and hide it again. I have the following HTML which works perfectly if I use one...
10
by: DettCom | last post by:
Hello, I would like to be able to display or hide fields based on whether a specific Yes/No radio button is selected. This is in conjunction with a posting a just made here in the same group...
1
by: microsoft | last post by:
I am looking for code for a button on a website, and I want it to prevent users from clicking more than once while their request is being processed. I would like it to disable or hide the button...
1
by: Bob Sanderson | last post by:
I have a form which uses several radio buttons to enter data. It works fine as far as entering goes, but I can't figure out how to display which button is checked when I view the record. I could do...
4
by: remya1000 | last post by:
I'm using ASP with MSAccess as database. i have two text box and one button in my page. and i need to select dates from calander and display it in this two textbox. but i dont need to place a...
1
by: Anne | last post by:
Hi, I have a gridview that display questions & answers. In some case the answers are text (up to 5000 char) and other cases they are tick boxes or numbers ($), or date. I have created 2...
1
by: femtox77 | last post by:
Hi, I try to show or hide a button when I click on checkboxes. I explain better. I'm learnig to use Jquery framework. I have a page with many rows and every row has a checkbox. I wanna show a...
3
by: PowerLifter1450 | last post by:
Hi all, I have to Combo boxes on a form. The first one I would always like users to see. The second, however, I would like hidden if the first box has certain values selected. So, if ComboBox1 has...
1
by: Alexander Vasilevsky | last post by:
How dynamically hide / show edit button in the gridview? http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas discount
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.