Hi,
I have a doubt whether it is possible to give the form validation error msg to the tooltip which is used for field description.
thanks in advance,
cheers,
vengo.
12 3790 gits 5,390
Recognized Expert Moderator Expert
please show your code ... what field, what tooltip do you mean?
kind regards
[HTML]<form name="test" method="post">
<tr>
<td>User Name:</td><td><input type="text" name="fname" id="fname" size="30" tooltipText="Ty pe in your First Name in this box" /></td>
</tr>
<tr>
<td>Password: </td><td><input type="password" name="pwd" value="" size="30" id="pwd" tooltipText="Ty pe in your Password in this box"></td>
</tr>
<tr>
<td> </td><td><input type="submit" name="Submit" value="Add" class="btn"></td>
</tr>
</form>
[/HTML]
The above will be my code in which there are two fields with the tool tip displaying about the description about those fields and if i want to validate the user name i want to display those validation text in to the same tooltip, is this possible?
regds
gits 5,390
Recognized Expert Moderator Expert
in your validation function refer to the node and use the setAttribute() method: - node.setAttribute('tooltiptext', 'your_validation_text');
kind regards
i gave the following validation, but i could get anything. is this correct? - <script language="javascript">
-
function validate()
-
{
-
var form=document.test;
-
-
if(form.fname.value == ''){
-
fname.setAttribute('tooltipText', 'enter user name');
-
form.fname.focus();
-
return false;
-
}
-
}
-
</script>
regds
gits 5,390
Recognized Expert Moderator Expert
you should refer with the form of course ... next you should use the type attribute of the script tag since the language attribute is deprecated, and attribute names should be written in lower case ... try the following: -
<script type="text/javascript">
-
function validate() {
-
var form = document.test;
-
-
if (form.fname.value == '') {
-
form.fname.setAttribute('tooltiptext', 'enter user name');
-
form.fname.focus();
-
return false;
-
}
-
}
-
</script>
-
kind regards
thanx, it is working now . but you know only after some other function like after returning from the password field or something like that.
first i gave the validate on the onclick event of submit and even tried it with the onblur of user name but the validation text appears in the tooltip only after some other function like i said above.
thanks again,
regds
vengo
gits 5,390
Recognized Expert Moderator Expert
sorry ... i don't get it ;( ... could you please post the code that shows how you did it?
kind regards
what i need is it should be displayed till the correct name given.
thanks
vengo
(script) - <script type="text/javascript">
-
function validate() {
-
var form = document.test;
-
-
if (form.fname.value == '') {
-
form.fname.setAttribute('tooltiptext', 'enter user name');
-
form.fname.focus();
-
return false;
-
}
-
}
-
</script>
(html)
[HTML]<table >
<form name="test" method="post">
<tr>
<td>User Name:</td><td><input type="text" name="fname" id="fname" size="30" tooltipText="Ty pe in your First Name in this box" onblur="return validate();"/></td>
</tr>
<tr>
<td>Password: </td><td><input type="password" name="pwd" value="" size="30" id="pwd" tooltipText="Ty pe in your Password in this box"></td>
</tr>
<tr>
<td> </td><td><input type="submit" name="Submit" value="Add" class="btn"></td>
</tr>
</form>
</table>[/HTML]
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: owen |
last post by:
Generally speaking, what does it mean when I see a "button" with red text
showing this message instead of the control I've dragged onto the web form
in Design View.? (But the page works fine at runtime). Does it indicate
a problem with References for example?
Thanks
Owen
PS. replies cc'd by email appreciated.
owen.southwood@mantix.com
|
by: x muzuo |
last post by:
Hi guys,
I have got a prob of javascript form validation which just doesnt work
with my ASP code. Can any one help me out please.
Here is the code:
{////<<head>
<title>IIBO Submit Page</title>
</head>
<style type="text/css">
|
by: Steve Cutting |
last post by:
Hi all,
Using the toolbox I added a tooltip provider to my form, and set the text
for each of my buttons using the properties window.
When I first show the form using .showdialog the tooltips work. However
if I close and re-open the form the tooltips are no longer displayed.
Am I missing something obvious or is this a bug ??
|
by: VB Programmer |
last post by:
I have several required field validators on each step of my
CreateUserWizard.
When I click Next it goes to the next step, even though the user hasn't
typed anything in.
I placed each "page" of validators in their own validation group.
Any ideas why this isn't working?
|
by: winnie_us99 |
last post by:
Hi All,
I am trying to do validation on my text field before going to the
next page to create a user. It doesn't look like the next button will
fire any validation. Am I missing something? Can anyone please help me
with this?
I am attaching my code piece. Thank you in advance for your help.
Wing
| |
by: julie.siebel |
last post by:
Hello all!
As embarrassing as it is to admit this, I've been designing db driven
websites using javascript and vbscript for about 6-7 years now, and I
am *horrible* at form validation.
To be honest I usually hire someone to do it for me, grab predone
scripts and kind of hack out the parts that I need, or just do very
minimal validation (e.g. this is numeric, this is alpha-numeric, etc.)
|
by: timnels |
last post by:
I have an issue where I have a user control that is launched into a
floating form. At some point later, I allow the user to "unfloat" the
user control by reparenting it on a split container in another form.
Problem is if I wake a tooltip when the window is floated, and then try
the same thing when it is reparented, the app crashes with " Cannot
access a disposed object.Object name: 'Form'.
Presumably, this is a result of the tooltips...
|
by: ak1dnar |
last post by:
Hi, I got this scripts from this URL
There is Error when i submit the form.
Line: 54
Error: 'document.getElementbyID(....)' is null or not an object
What is this error.
Complete Files
|
by: Mr. X. |
last post by:
Hello.
In Visual Studio 2008,
there is on the toolbox -login -login,
which create a login form.
On that form there is a LoginButton, which click on it is evented on the
"default.aspx.vb" codeBehind.
How can I use the value on the codeBehind (default.aspx.vb) of UserName &
|
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,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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
| |