Solved

Forms without push buttons?

Posted on 2000-02-22
14
213 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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

791 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