473,840 Members | 1,600 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hide & show divs with different text msgs in the same place on the screen???

Hello, I've searched on toggling divs and didn't really find what I was
looking for, I saved a bunch of different threads.

I have a form with several different text boxes for things like dates,
numbers, etc. arranged in a table, each row has the same kind of text
boxes for data entry (10 rows probably).

I want to have a separate section above the form where I can toggle a
div containing an appropriate error message to appear after the
onchange event fires for the text box.

The thing is, I want all the divs with their different text messages to
appear in the same place and disappear from the same place above the
form instead of different places on the form or web page.

Well, they don't have to be multiple divs, but there are multiple
different error messages that should appear depending where the user is
typing...

Example: 'wrong format,' 'month must be between 1 and 12,' etc. Of
course the messages will be nicer than this.

This basically just has to work in IE 6.x, it's an intranet form, well
maybe also Firefox (the best!).

Thank you, Tom

Dec 7 '05 #1
5 3625
tlyczko wrote:
Hello, I've searched on toggling divs and didn't really find what I was
looking for, I saved a bunch of different threads.

I have a form with several different text boxes for things like dates,
numbers, etc. arranged in a table, each row has the same kind of text
boxes for data entry (10 rows probably).

I want to have a separate section above the form where I can toggle a
div containing an appropriate error message to appear after the
onchange event fires for the text box.

The thing is, I want all the divs with their different text messages to
appear in the same place and disappear from the same place above the
form instead of different places on the form or web page.

Why not have one div and just change the message?

<script type="text/javascript">

function showMessage(id, msg)
{
if (document.getEl ementById){
var mBox = document.getEle mentById(id);
if (mBox.firstChil d) {
mBox.firstChild .data = msg;
} else {
if (mBox.appendChi ld && document.create TextNode){
mBox.appendChil d(document.crea teTextNode(msg) );
} else if(mBox.innerHT ML){
mBox.innerHTML = msg;
}
}
}
}

</script>

<div id="messageBox "
style="border: 1px solid red; width: 20em; height: 3em"></div>
<form action="">
<input type="text" name="message">
<input type="button" value="Show message"
onclick="showMe ssage('messageB ox',this.form.m essage.value)">
</form>

[...]
--
Rob
Dec 7 '05 #2
Ah...thank you...You are a *genius* with this...That's the same thing I
was talking about, only you expressed it differently. I will test this
out, see how it works, etc., then modify it to run from the onchange
event as opposed to clicking a button.

I will use it to display error messages when the end user enters data
into a form field.

Thank you again, Tom

Dec 8 '05 #3
Ah...thank you...You are a *genius* with this...That's the same thing I
was talking about, only you expressed it differently. I will test this
out, see how it works, etc., then modify it to run from the onchange
event as opposed to clicking a button.

I will use it to display error messages when the end user enters data
into a form field.

Thank you again, Tom

Dec 8 '05 #4
Ah...thank you...You are a *genius* with this...That's the same thing I
was talking about, only you expressed it differently. I will test this
out, see how it works, etc., then modify it to run from the onchange
event as opposed to clicking a button.

I will use it to display error messages when the end user enters data
into a form field.

Thank you again, Tom

Dec 8 '05 #5
Ah...thank you...You are a *genius* with this...That's the same thing I
was talking about, only you expressed it differently. I will test this
out, see how it works, etc., then modify it to run from the onchange
event as opposed to clicking a button.

I will use it to display error messages when the end user enters data
into a form field.

Thank you again, Tom

Dec 8 '05 #6

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

Similar topics

2
4725
by: Doug van Vianen | last post by:
Hi, I am using Choice to provide a dropdown menu in an Applet. I create the Choice and then need to hide it until it is needed and then show it. I use c.hide() and c.show() where 'c' is the choice. This works fine except that when I use javac to compile the code I get the message that I am using a deprecated API. That is, hide() and show() for choices (and presumably other items) is no longer used. I have tried doing a search to find...
16
4223
by: Geoff Cox | last post by:
Hello, I publish some web pages using large fonts and would like to give the user the opportunity to print the pages using a smaller font. I believe that this is possible using different style sheets? I am not clear how the user would select the different .css files? Seems to be easier than having duplicate html files ...
12
6310
by: deko | last post by:
Is there any way to work around the blank space created by hidden divs? I'm trying to use a relatively postioned divs with show/hide behaviors to annotate an image. The divs show/hide onMouseOver/onMouseOut but leave a blank space on the page when hidden (the space where the divs would normally be). Is it possible to use z-indexing to put regular content where the hidden divs would be? When I try to do this, the layers don't unhide as...
4
2864
by: Brian | last post by:
Hi there I'm not so hot on JavaScript so not sure if this can be done. I have a PHP page that runs a MySQl query, while these queries are running I would like to show a message saying 'Processing....' once the query has finished running the message disappears. I was thinking of showing then hiding a layer, but I don't know how to say, show this message at a set point eg below the select box on the screen
0
2106
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display some stuff in the main display area. The stuff to display is one of many assemblies loaded at the opening of the application by Activator.CreateInstance, because I want it independant of the main application, as a plugin. All assembly are loaded...
2
1425
by: Juergen Kareta | last post by:
Hello list, I'm thinking about a python script which fetch some text from the screen independent of what application provides the text on the screen. In this regard it should be similar to the babylon software: www.babylon.com Here my thoughts: 1) getting the mouse position
3
1666
ddtpmyra
by: ddtpmyra | last post by:
Hi, Im looking for a sample script on how to hide and show text box with query statement inside of it. It looks like this.
2
1814
by: Prashanthpacchu | last post by:
Hi I am developing an website. So in that i m trying to make like an image slide show. just like in www.habtoor.com. But i am using 3 buttons on leftside. 6 images are used for this 3 buttons. It means 2 images for each button. One ia on mouse over and anthor is on mouse out. Along with this, when mouse over on any particular button it displays the respective image on right side.so for right side i am using 3 images. when mouseover on any...
0
9860
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9699
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10603
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10660
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7838
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4498
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4076
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.