Hi ,
Thanks for your reply.
I am facing a wierd problem .
In the form I have <CFINPUT> tags which are used to do
the validations and also have javascript code to check
if there is any file name specified or not.As the user
has to select a file either by uploading or from the
dropdown list.But here in the form I also have
"FirstName" text field which when not filled by the
user throws a javascript alert message because of
<CFINPUT> tag.

Now only the javascipt code is working as I have
specified "oncheck()" in the input tag of the submit
button.
Is there any way to use javascipt validations and
cfinput tag validations together.

Please take a look at the code as I am not able to
explain it in words.
Thanks 
Shally
+++++++++++++++++++++++++++++++++++++++++++++++++++

<html>
<head>
<title>Untitled Document</title>

<script language="javascript">
function ChangeFileName()
{
     if(document.SelectFileForm.SelectFile.value !=
"")
     {
     document.SelectFileForm.FileName.disabled =
!document.SelectFileForm.FileName.disabled;
      alert('You have selected a file');
      return;
      }
     else
     {
     if(document.SelectFileForm.SelectFile.value ==
"")
          {
          document.SelectFileForm.FileName.disabled =
!document.SelectFileForm.FileName.disabled;
          }
     }
}

function ChangeSelectFile()
{
     if(document.SelectFileForm.FileName.value != "")
     {
     document.SelectFileForm.SelectFile.disabled =
!document.SelectFileForm.SelectFile.disabled;
     }
     else
     {
     if(document.SelectFileForm.FileName.value == "")
          {
          document.SelectFileForm.SelectFile.disabled
= !document.SelectFileForm.SelectFile.disabled;
          }
     }
}
function check()
{
      if(document.SelectFileForm.SelectFile.value ==
"")
      {
           if(document.SelectFileForm.FileName.value
== "")
           {
                alert('You have to selct a file');
               return;
           }
        }      
       
       SelectFileForm.submit();
       
}
</script>


<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF">
<cfform method="post" action="next.cfm"
name="SelectFileForm">
  <p>Your Name 
    <cfinput type="text" name="textfield"
required="yes" message="Please enter your name">
  </p>
  <p>Select from 
    <select name="SelectFile" size="1"
onchange="ChangeFileName()">
      <option value="">None 
      <option value="One">One</option>
      <option value="Two">Two</option>
      <option value="three">Three</option>
    </select>
    or </p>
  <p>Select from 
    <input type="file" name="FileName"
enctype="multipart/form-data"
onchange="ChangeSelectFile()">
  </p>
  <p>
    <input type="button" name="Submit" value="Submit"
onclick='check()'>
  </p>
  </cfform>
</body>
</html> 
+++++++++++++++++++++++++++++++++++++++++++++++++++++

--- Bill King <[EMAIL PROTECTED]> wrote:
> I am not sure if I understand 100% but you will not
> be able to submit a
> query to the database on the same form as a select
> box.
> 
> There are two ways, though, that you can handle what
> (I believe) you are
> trying to attempt:
> 
> 1.  On change of the select form you can simply
> re-load the same form with
> the next item selected.  You can go to
>
http://www.hemmings.com/classifieds/generic/step1.cfm?ad=1
> to see one that I
> did.
> 
> 2.  You can create a JS file and use JavaScript to
> create an array of values
> to display based on the select item chosen.
> 
> Good Luck.
> 
> - BILL -
> 
> -----Original Message-----
> From: David Clay [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 05, 2001 4:30 PM
> To: CF-Talk
> Subject: SELECT
> 
> 
> Does anyone have code to set a variable once a
> select box option has been
> selected to use within a query in the same form.
> 
> Thank you for your time.
> 
> Dave Clay
> Internet Facilitator
> Trus Joist, A Weyerhaeuser Business
> 5995 Greenwood Plaza Blvd, Suite 100
> Greenwood Village, CO 80111
> 303.770.8506
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to