Link to home
Start Free TrialLog in
Avatar of cb1
cb1

asked on

Forms without push buttons?

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.
Avatar of selmer
selmer

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

ASKER CERTIFIED SOLUTION
Avatar of deepchanda
deepchanda

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It can only be done with JavaScript or Java and I would recommend JavaScript.

<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>
Avatar of cb1

ASKER

Thanks for the code, can you tell me what browser version this is compatible with?
Avatar of cb1

ASKER

Thanks for the code, can you tell me what browser version this is compatible with?
it work with both browser ie and netscape i check it personally
Avatar of cb1

ASKER

version 3 and above?
I check it in ie4 and netscape 4.6 and 4.7
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
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 :(
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
Avatar of cb1

ASKER

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.
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!