How can I program a form to submit multiple queries and show each response in a

How can I program a form to submit multiple queries and show each response in a

Question:
How can I program a form to submit multiple queries and show each response in a different frame?

Answer:
In JavaScript, the onClick event handler can be used to control many aspects of form submission. For example, the following code might be used to submit the same form data to two different servers:

<input type=submit onClick=" form . action = 'first_URL' form . target = 'first_frame' form . submit (); form . action = 'second_URL'; form . target = 'second_frame'; form . submit (); return false;">

In this example, before each invocation of the form’s submit method, the action property is defined so that each call to the submit method sends the query data to a different server. Similarly, the target property is configured so that the the servers’ responses are shown in separate frames. This event handler code returns a false value to prevent the interpreter from submitting the form a third time. (Of course, we could also have omitted both the second submit call and the return statement to achieve the same result.)

Unfortunately, on the (Windows 95) browsers I tested, the code shown above does not perform the way it should. This is due in part to the fact that the ongoing browser war between Netscape Communications and Microsoft has caused both companies to rush production and thus release imperfect implementations of JavaScript.

Internet Explorer 3.0 fails because it does not support assignment to the form object’s action and target properties. Netscape Navigator 3.0 supports the assignment but does not properly handle multiple calls to the submit method, because Netscape does not issue the HTTP request until after the interpreter has returned from the event handler. As a result, only the last in a series of calls to the submit method works correctly.

Not all is lost; there are probably many ways to work around this problem. For example, if you have any control over the contents returned by the servers you are querying, you might be able to include an onLoad event handler with the first server’s response, so that when it is loaded, it resubmits the form to the second server. This is a rather difficult kludge, but it is possible.

Or you could wait for Microsoft and Netscape to finish debugging their JavaScript interpreters… 🙂

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several

data fivetran pricing

Fivetran Pricing Explained

One of the biggest trends of the 21st century is the massive surge in analytics. Analytics is the process of utilizing data to drive future decision-making. With so much of

kubernetes logging

Kubernetes Logging: What You Need to Know

Kubernetes from Google is one of the most popular open-source and free container management solutions made to make managing and deploying applications easier. It has a solid architecture that makes

ransomware cyber attack

Why Is Ransomware Such a Major Threat?

One of the most significant cyber threats faced by modern organizations is a ransomware attack. Ransomware attacks have grown in both sophistication and frequency over the past few years, forcing