Solved

Spry validation with file fields

Posted on 2007-11-27
1
1,655 Views
Last Modified: 2012-05-05
I understand how to use Spry in DW to validate text fields, checkboxes, radios and so fourth but how do you validate a file field with the same validating features (CSS Styles)? I try just using a textfield and then change it to a file field but Spry gets confused.

Thanks
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
 
<span id="sprytextfield2">
            <label>
            <input type="file" name="company_logo" id="company_logo" />
            </label>
            <span class="textfieldRequiredMsg">A value is required.</span></span>
 
<script type="text/javascript">
<!--
 
var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "none", {validateOn:["blur"]});
 
//-->
</script>

Open in new window

0
Comment
Question by:brihol44
1 Comment
 
LVL 17

Accepted Solution

by:
gops1 earned 500 total points
ID: 20362832
How can you give a span ID for validation, it should be the file element's name "company_logo"
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

820 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