You do know that the disabled property only works in IE, right?

Why don't you use the onsubit action on the form tag to validate data?

Here...

<script language="Javascript">
function checkValues(){
if (whaever.test.value == ""){
        return false
        }
return true
}
</script>

<form name="whatever" method="post" action="someurl.cfm"
onsubit="Javascript: return checkValues();">
        <input name="test" value="">
</form>

The other thing you can do is convert the button from a submit to just a
button.  What happens is the submit action will fire regardless of whether
you do anything about it.  The onclick even superceeds the submit event, but
that event will fire and you cannot stop it thtough the onlick event of a
submit button.


-----Original Message-----
From: Dennis Powers [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, April 18, 2001 11:57 AM
To: CF-Talk
Subject: RE: make the select menu a must select


Paul,

There are plenty of ways to do this, I often use a disabled submit button
and the following function to re-enable it.  However you should always do
error checking on the action form.

- place in the head tag -

function GotChange(j)
        {
        document.forms[0].go.disabled = false;
        }

- place in the head tag -

Then use the onChange event

<select name="ImageNumber" onChange="GotChange();">
        <option value="0">Select Options</option>
        <option value="1">Options 1 </option>
        <option value="2">Options 2 </option>
</select>

Set the Submit button to disabled.

<input type="submit" name="go" value="Upload Files" disabled>



Best Regards,

Dennis Powers
UXB Internet
(203) 879-2844
http://www.uxbinfo.com/

-----Original Message-----
From: paul . [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 18, 2001 11:56 AM
To: CF-Talk
Subject: make the select menu a must select

Hi Guys !.
i need this select menu a must selct when i submit the form atleast one item
has to be selcted Kindly help me
-------------------------------------
  <select name="member_role">
                  <option value="0"></option>

                  <cfoutput query=qry_get_roles>
                    <option
value="#qry_get_roles.rec_id#">#qry_get_roles.role_name#-
                    <cfset role_type="CA Staff">
                    <cfif type eq 2>
                    <cfset role_type="Support">
                    <cfelseif type eq 3>
                    <cfset role_type="Liaison">
                    </cfif>
                    #role_type#</option>
                  </cfoutput>
                </select>
                </font></td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    <p>
      <input type="submit" name="Submit" value="Add Team Member"
onclick="validate">
    </p>
    </div>
--------------------------------------
<script language ="javascript">
function validate(theform)
        {
        if(theform.member_role.selectedindex!=-1)
        theform.submit();
        else
                {alert ("Plese select");
                }
        }
</script>




-paul
 this is the javascript i tried


Get 250 color business cards for FREE!
http://businesscards.lycos.com/vp/fastpath/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to