Solved

Forms without push buttons?

Posted on 2000-02-22
14
193 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
  • 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
 
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Unsearchable in Google,Yahoo and Bing. 6 55
Common Front Ends using Dynamics CRM 3 72
SSL sertificate 5 48
Summernote required 3 57
Now that Expression Web 4.0 (http://www.microsoft.com/expression/products/Upgrade.aspx) is free if you buy or have the full version of Expression Web 3.0, now is the best time to  migrate from FrontPage to Expression Web (http://www.frontpage-to-exp…
Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now