Solved

Spry validation with file fields

Posted on 2007-11-27
1
1,661 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Node.js 11 76
Looking for solution to pass data to 3rd-party web platform? 4 58
Check if field exists SPUtility 5 47
Jquery Calculation 3 39
This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

739 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