473,396 Members | 2,011 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.

How to avoid double click on a link next an input

I have a form containing a link next to an input box. I include a
javascript function in the input by using the onblur='fuc()'. I used
this function to open another ASP page to do something and then close
the window. There was no problem if I just clicked other place on the
form. everything was working as charm. However, If I want to click the
link next to it after I moved out the input box, I always have to click
twice in order to open the page directed by the link. Is there another
event handler which can replace the onblur so that I do not need to
click twice on the link. This problem bothers me for couple days.
Although I have tried several event handler (from onblur, onchange,
onmuseout), none of work as I expect. Hope any guru can drop some tip?
I am jst a casual user of javascript and the html. Thanks.

C Chang
Jul 23 '05 #1
2 4159
Hi chang, can you put the html which ur working so that i can see what
exactly happening.

Jul 23 '05 #2
ch***************@gmail.com wrote:
Hi chang, can you put the html which ur working so that i can see what
exactly happening.

Sine the Web page was created by the ASP reponse.write, I include the
write out here as I grab from the view source
<htm>
...
<script language=javascript>
function checkRole(guest)
{
if (guest == 'guest') {
var val = document.Form1.Text1.value;
var win = window.open('otherPage.asp?val='+val, 'name');
win.close();
}
else (
//do something else
)
}

function addAddress()
{
var val = document.Form1.Text1.value;
var win = window.open('secondPage.asp?val='+val, 'name');
}

-->
</script>
<body>
<form name=Form1 >
<a href="#" onclick="addAddress();">Add Address</a>
<input type=Text name=Text1 value="myemail@hotmail;.."
onblur="checkRole('guest')>
<input type=Text name=Text2 value="" >

......
</form>
</body>
</html>

Above is the part that I have problem. The values in the Text1 and in
the function of checkRole(..) were entered by the Database return.
Basically, I tried to prevent user to change the old value in the input
field if they do not meet certain condition, after that user can either
click on the link (Add Address) to open an pop-up address book to do
something else or continue other input fields on the page. The page is
huge. However, if user meet the role, whatever user add extra value in
the text1 value field, the function call will open the otherPage.asp to
process the value. That is problem come in. because when user click on
the link first time, the process on the ohterpage is working and done (I
can see the a quick window open and close), So the secnodPage will not
open, until I click again on the link. I want to know how to avoid
that. Is the onafterupdate event available for the <input>? It is
mentioned in the Jscript reference. Thanks.

C Chang

Jul 23 '05 #3

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

Similar topics

2
by: Rob Mayo | last post by:
OK, maybe this is my opinion, maybe these are bugs. Given the folowing: I have a NotifyIcon on my Form, a Context menu associated with the NotifyIcon, and a MenuItem on the ContextMenu set as...
6
by: Richard A. Lowe | last post by:
I'm using P/Invoke to call SendInput (using code culled from these newsgroups!) to send mouse events to a window. But I'm unsure how to send double-clicks. A VB6 article I saw on SendInput...
6
by: Brian Smith | last post by:
Is there a way to avoid the default action of TreeNode expansion/contraction caused by double click? I can add an event handler to pop up my properties dialog on double click, but it has the...
0
by: Daniel Bass | last post by:
I've got a button (server side) next to a list box (server side)... is it possible, that on a double click on the listbox, and event can cause a button click simulation? I've manually inserted...
7
by: Pam | last post by:
When I double click on a event in a form I want it to bring up another form and load the same data so it can be edited. I'm having a hard time doing this. The new form loads;but my file can't...
6
by: Sakharam Phapale | last post by:
Hi All, How to capture Mouse Single click and mouse double click event on Commnad Button. I am doing as follows. Private Sub Button1_MouseUp(ByVal sender As Object, ByVal e As...
3
by: Siv | last post by:
Hi, I have a ListView control in a Windows application, currently single clicking a customer name in this list, selects the customer and displays their details in text boxes to the right of the...
3
by: =?Utf-8?B?V2lsbA==?= | last post by:
I have an image "button" which causes a postback. I handle the "click" with If Request.Form("btnBU7WD6_Submit.X") 0 Then... this works great. However, when a user double-clicks the image...
3
by: Zippy | last post by:
I have recently moved from A97 to A2003. I find it inconvenient that I can no longer double-click on the subform to open it in full view. I had a hunt around the newgroups and couldn't find...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
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
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.