473,594 Members | 2,756 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP button does not work when running from the script?

Hello,

Trying to run a script what start ASP button:

document.Form1. all["btnNewPassUpda te"].click();

It is work one time only. Next script ignore it. Where can be
problem???

A full script is as follows:
<script language="javas cript" type="text/javascript">
function ChangePass(NewP ass)
{
var windowsize
"center:yes;dia logHeight:230px ;dialogWidth:43 0px;toolbar:no; menubar:no;stat us:no;directori es:no;scrollbar s:no;location:n o;resizable=no" ;

var retVal;
NewPass = window.showModa lDialog("Change Password.aspx?" ,"",windowsize) ;
if(NewPass !== "")
{
document.Form1. all["txbNewPass "].value = NewPass;
return document.Form1. all["btnNewPassUpda te"].click();
}
else return false;
}
</script>

Thanks,
eugene

Jul 23 '05 #1
4 2786
In article <11************ **********@o13g 2000cwo.googleg roups.com>,
es*****@gmail.c om enlightened us with...
Hello,

Trying to run a script what start ASP button:

document.Form1. all["btnNewPassUpda te"].click();

You might want to get used to document.getEle mentById instead of
document.all.
It is work one time only. Next script ignore it. Where can be
problem???
A script error halting execution. Do you have MSIE set to display all script
errors? When developing, you should.

A full script is as follows:
<script language="javas cript" type="text/javascript">
function ChangePass(NewP ass)
{
var windowsize
"center:yes;dia logHeight:230px ;dialogWidth:43 0px;toolbar:no; menubar:no;stat us:no;directori es:no;scrollbar s:no;location:n o;resizable=no" ;

Missing an equal sign for assignment or something. Typo?
The above makes no sense.
var retVal;
NewPass = window.showModa lDialog("Change Password.aspx?" ,"",windowsize) ;
if(NewPass !== "")
!== ?
That is not valid as far as I know for javascript. You want != instead.
{
document.Form1. all["txbNewPass "].value = NewPass;
return document.Form1. all["btnNewPassUpda te"].click();


Um, what's that supposed to do?
Click is void.
Syntax
object.click()
Return Value
No return value.

Are you mixing up vb and javascript syntax and operators, perhaps?

--
--
~kaeli~
I love God. It's His fanclub that I can't stand.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #2
Ok. Thank you for the answer. Some remarks:
1. Do you have MSIE set to display all script errors?
No. Where can I get it? URL please. Thank you.
2. You might want to get used to document.getEle mentById instead of
document.all.
It does not matter because script can found the button. When I put
alerts before/after
this line it showed me that alert and also showed that object:
all["btnNewPass*Upd ate"]
Moreover it perfectly worked before.
2. return document.Form1. all["btnNewPass*Upd ate"].click(); Um, what's
that supposed to do?
It supposed to click a small ASP button. When I click it manually my
ASP code work well. But it ignore it in script in runtime. I also
tried the case like this:
document.Form1. all["ASPbtnName "].click();
return true;
same thing...

Jul 23 '05 #3
I've also had some finicky behavior trying to use .click() methods.
Fortunately they're generally not necessary, so in general I work
around them.

If all you want is to submit the form, use the .submit() method of your
form element. If you want to call the onclick event handler for your
button, do so manually, then submit the form if appropriate.

es*****@gmail.c om wrote:
Ok. Thank you for the answer. Some remarks:
1. Do you have MSIE set to display all script errors?
No. Where can I get it? URL please. Thank you.
2. You might want to get used to document.getEle mentById instead of
document.all.
It does not matter because script can found the button. When I put
alerts before/after
this line it showed me that alert and also showed that object:
all["btnNewPass*Upd ate"]
Moreover it perfectly worked before.
2. return document.Form1. all["btnNewPass*Upd ate"].click(); Um, what's
that supposed to do?
It supposed to click a small ASP button. When I click it manually my
ASP code work well. But it ignore it in script in runtime. I also
tried the case like this:
document.Form1. all["ASPbtnName "].click();
return true;
same thing...


Jul 23 '05 #4
es*****@gmail.c om wrote:
Ok. Thank you for the answer. Some remarks:
1. Do you have MSIE set to display all script errors?
No. Where can I get it? URL please. Thank you.
[and so on]


<http://jibbering.com/faq/>
PointedEars
Jul 23 '05 #5

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

Similar topics

14
5446
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net that works well as an html page. It brings up a modal popup window that I have been trying to work out for days now and this was the closest I have been able to come. I added a little asp.net code and an asp.net button and cannot get it to
11
6945
by: Dot net work | last post by:
Hello. I've read many posts about disabling submit buttons, but I can't get these answers to solve my problem. I have a server side asp.net button, and under the button I have code behind that does some simple processing, followed by a response.redirect. When the user clicks on this button, I would like the button to
11
13900
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to all users (btnSendAll). When user hits enter, I also simulate the effect of clicking button (btnSend). However, what I found btnSend doesn't fire (unless I click on the button). The postback function I call is as follows: function...
4
2994
by: nicholas | last post by:
Weird thing: Got an aspx page with a button and an associated code in VB.net. On my testing server the page works fine. On the old hosters server the page worked fine too. But now, at the new hoster it does not. When I click on the submit button: nothing happens. The only thing that works is form validation.
7
2475
by: Sridhar | last post by:
Hi, I have a question regarding the Page_Load method and Back Button of Internet explorer. I have created a webform. In that webform I have several Text Boxes. Also I have two buttons. When I click on button1, it populates the text boxes with person1 details. When I click on button2, it populates the text box with person2 details and redirects to webform2. In webform2 if I click on Back Button of Internet Explorer it should display...
11
11233
by: cindy | last post by:
I have a form, has javascript registered so a modal pops up. Button click will close form. Now I need to do an update with modal form data before it closes. I can put a second button and register the onclick attribute of the second button to the javascript to close the form after user clicks upload button click upload do the update to database then programmatically click the second button the use on onclick attribute that sees the...
3
1474
by: Jeff User | last post by:
Greeting I built asp.net (V1.1) page. I want to use this button to reset SelectedIndex=0 on several drop down lists. However, I do not want to post back to server. The point is to avoid the round trip. It had an asp:button which would post back to the server when clicked but changed it to an input button to avoid the postback. (If that is not needed,let me know)
1
2973
by: brianpmccullough | last post by:
I have an ASP.NET page that has a few buttons on it. One of the buttons kicks off a long running process on the web server and I want to prevent the user from clicking the button again while the long running process is working (i.e. before the page completes it's "postback"). I tried something like so, but it didn't work: <script language="javascript"> function confirmWinnerSelection(myBtn){ if (confirm('Are you sure?')) {
0
7946
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
8251
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, 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...
0
8372
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
8003
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
5739
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
5408
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3859
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...
0
3897
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2385
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

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.