Solved

Forms without push buttons?

Posted on 2000-02-22
14
202 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
New My Cloud Pro Series - organize everything!

With space to keep virtually everything, the My Cloud Pro Series offers your team the network storage to edit, save and share production files from anywhere with an internet connection. Compatible with both Mac and PC, you're able to protect your content regardless of OS.

 

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

Network it in WD Red

There's an industry-leading WD Red drive for every compatible NAS system to help fulfill your data storage needs. With drives up to 8TB, WD Red offers a wide array of solutions for customers looking to build the biggest, best-performing NAS storage solution.  

Question has a verified solution.

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

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. 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 :…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…

932 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

10 Experts available now in Live!

Get 1:1 Help Now