Solved

Forms without push buttons?

Posted on 2000-02-22
14
226 Views
Last Modified: 2013-12-24
Is it possible to have a form in ColdFusion which performs the form action when an value from the list box is selected rather than clicking on a Push button or does this have to be done with Javascript? Note I will only have one list box in the form and no other objects.
0
Comment
Question by:cb1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +4
14 Comments
 

Expert Comment

by:selmer
ID: 2547260
I don't think it can be done with straight ColdFusion... i myself spent quite some time trying to do it that way, so i'm pretty sure it has to be javascript, unfortunately i can't really help you with the actual code, sorry

-josh

0
 
LVL 1

Accepted Solution

by:
deepchanda earned 50 total points
ID: 2547366
This can be easily done in javascript, here it goes ...


<script>
function submitform() {
     document.formname.submit();
     return true;
   }
</script>

<form name="form1" action="abc.htm">
<SELECT
  NAME="selectName"
  ONCHANGE="return submitform()"
>
..

</form>
0
 
LVL 5

Expert Comment

by:nathans
ID: 2549059
It can only be done with JavaScript or Java and I would recommend JavaScript.

0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 4

Expert Comment

by:FRehman
ID: 2549619
<HTML>
<HEAD>

<BR>
<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function select1_onchange() {

            document.form1.action="page2.asp"
            document.form1.submit();

}

//-->
</SCRIPT>
</HEAD>
<BODY>
<form name=form1 method=post action="">


<P><SELECT id=select1 name=select1 style="HEIGHT: 22px; WIDTH: 151px" LANGUAGE=javascript onchange="return select1_onchange()">
        <OPTION selected value=asd>sadsa
        <OPTION value=sdf>sr342</SELECT>
</P>
        
</form>
</BODY>
</HTML>
0
 

Author Comment

by:cb1
ID: 2549698
Thanks for the code, can you tell me what browser version this is compatible with?
0
 

Author Comment

by:cb1
ID: 2549729
Thanks for the code, can you tell me what browser version this is compatible with?
0
 
LVL 4

Expert Comment

by:FRehman
ID: 2549790
it work with both browser ie and netscape i check it personally
0
 

Author Comment

by:cb1
ID: 2549840
version 3 and above?
0
 
LVL 4

Expert Comment

by:FRehman
ID: 2550025
I check it in ie4 and netscape 4.6 and 4.7
0
 
LVL 1

Expert Comment

by:deepchanda
ID: 2550473
FRehman

I think you have repeated my suggestion as an answer. The only thing different I found was that in your code the form action can be assigned at run-time, but that was not mentioned anywhere in  the original question.

DC
0
 
LVL 1

Expert Comment

by:bigbadb
ID: 2550510
it is too bad that people like FRehman steal answers from others then post it as an answer!!!!  Shame on you FRehman at least post as a comment :(
0
 
LVL 4

Expert Comment

by:FRehman
ID: 2553172
dear bigbadb
         when some one ask any question please describe it briefly not write short .when I answer any body I try to describe it briefly and user can easlyt understand it you i think cb1 has common scense if he think that I was wrong then he regect my answer
0
 

Author Comment

by:cb1
ID: 2553606
Just to point out 'he' is a 'she'! Thanks to you all for your help. Sorry FRehman but I feel I should accept DeepChanda's answer as they are both similar and DeepChanda's was first.
0
 

Expert Comment

by:jacqueschoquette
ID: 2555504
Actualy if you read the question again it should have been  nathans  who got the credit he was the first to answer the question correctly!
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question