473,399 Members | 3,302 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,399 software developers and data experts.

recquires 2 clicks to activate buttons

hey guys, i'm trying to make a simple web service(it returns a string that
says "Hello World") and i can call it, have all the javascript i need for it
that i am aware of, but the fist time i push the button it doesnt do anything
but the second time it works, then it will work randomly from then on. i
could go 4 or 5 clicks and have it work perfectly then for some reason it
will stop working for a click. heres the code

<SCRIPT language="JavaScript">
<!--
// All these variables must be global,
// because they are used in both init() and onResult().
var iCallID = 0;
var intA = 5;
var intB = 6;

function init() {
service.useService("Service1.asmx?WSDL","test");
}
function test(){
iCallID = service.test.callService(svcResults,
"HelloWorld","Synchronous Call");
}

function klar(){
document.Form1.fileContents.focus();
}

function svcResults(result){
if((result.eror)&&(iCallId==result.id))
{
var xfaultcode= result.errorDetail.code;
var xfaultstring=result.errorDetail.string;
var xfaultsoap=result.errorDetail.raw;
document.Form1.fileContents.value="errorcode"+xfau ltcode+"\n \n error
string"+xfaultstring+ "\n\n soap raw"+xfaultsoap;
}else if((!result.error)&&(iCallId=result.id))
{
document.Form1.fileContents.value+=" "+result.value;
}
}

//-->
</SCRIPT>
</HEAD>
<body onload="init()" >
<div id="service" style="BEHAVIOR:url(webservice.htc)"></div>
<form id="Form1" onfocus="klar()" method="post"
encType="multipart/form-data" runat="server">
<textarea name="fileContents" onfocus="test()" style="WIDTH: 288px;
HEIGHT: 224px"></textarea>
<input type="button" onclick="test();" name="btnSubmit" value="Submit
Query">
<input type="button" onclick="klar();" name="btnclear" value="klar">
</form>

</body>

i tried to make it work on page load since the goal is to make it callable
programatically(sp?) but it says system.test is null or not an object when i
try taht (btw the klar button has the same problem as the submit query button
it just has a round about way of getting to the function

thanks in advance for your help

john
Nov 23 '05 #1
0 766

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

Similar topics

3
by: Salad | last post by:
I have a form with a few command buttons. These command buttons open forms. In the OnActivate event of the main form I put in the line msgbox "Activate" When I press a button to open a form,...
0
by: John | last post by:
hey guys, i'm trying to make a simple web service(it returns a string that says "Hello World") and i can call it, have all the javascript i need for it that i am aware of, but the fist time i push...
5
by: mayur_hirpara | last post by:
Hi, I have been developing web applications for a while now. However, as I was thinking through the architecture I really don't understand the "How server can identify between which buttons has...
4
by: jonny | last post by:
I would like to add a password and user name to my website. If the username and password is correct than activate the hyperlinks and buttons. Could you please share some code how how to achieve...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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:
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
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,...
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
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...
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...
0
agi2029
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,...

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.