Solved

Spry validation with file fields

Posted on 2007-11-27
1
1,639 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
Comment Utility
How can you give a span ID for validation, it should be the file element's name "company_logo"
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

763 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

11 Experts available now in Live!

Get 1:1 Help Now