|
|
Register
|
Login
Home
Products
XMod
Features
XMod Demos
Repeater Template
Tabstrip
AJAX
Ordered, Unordered and Definition Lists
Navigation Bars
News Articles
Scrolling
Fading News Ticker
Grid Layout Sample
Photo Gallery (Lightbox)
What's New in XMod 5.0?
XMod Screenshots
XMod Showcase
Form and Template Exchange
XMod Add-Ons
ScreenCasts
XMod Calendar
XMod RSS Reader
XMod Pro
XMod Pro Screencasts
Demo
Testify!
Development Services
Support
Forums
Knowledge Base
Blog
Contact
»
Support
>
Knowledge Base
Thursday, March 11, 2010
What's New
[XMod Pro]
Where is the XMod Pro Manual?
[XMod Pro]
Using A Stored Procedcure iin Forms
[XMod Pro]
Invalid Column Name Error Message
[XMod Pro]
Access Data in a Non-DNN Database
[XMod Pro]
Control Panel Too Skinny
[XMod Pro]
Hiding A File Upload Control If A File Has Been Uploaded
[XMod Pro]
How Can I Move Forms/Templates to Child Portal Sites?
[XMod Pro]
Eligibility for upgrade to XMod Pro 2
[XMod Pro]
Hiow Do I Purchase Additional Licenses?
[XMod]
Upgrading XMod 5 from DNN 4.x to 5.x
Home
Products
XMod
Features
XMod Demos
Repeater Template
Tabstrip
AJAX
Ordered, Unordered and Definition Lists
Navigation Bars
News Articles
Scrolling
Fading News Ticker
Grid Layout Sample
Photo Gallery (Lightbox)
What's New in XMod 5.0?
XMod Screenshots
XMod Showcase
Form and Template Exchange
XMod Add-Ons
ScreenCasts
XMod Calendar
XMod RSS Reader
XMod Pro
XMod Pro Screencasts
Demo
Testify!
Development Services
Support
Forums
Knowledge Base
Blog
Contact
Knowledge Base
Unanswered
Active Topics
Forums
Search
Forums
>
XMod Pro
>
Samples and Examples
Hiding A File Upload Control If A File Has Been Uploaded
Last Post 29 Jan 2010 10:06 AM by DNNDev Admin. 0 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
DNNDev Admin
Posts:5641
29 Jan 2010 10:06 AM
XMod Pro provides a file upload control that enables your users to upload files to your website. When saving the record, the file's name is stored in your database. When editing the record, the file's name is displayed and a link to upload a file is displayed next to it.
We received a request from a customer who wanted to be able to hide that Upload link when editing a record if a file had been previously uploaded. This is easily accomplished using jQuery in your EditForm:
In this example, I've given an ID of "fuFile" to the FileUpload control. You'll need to modify it to meet your control's ID.
<ScriptBlock BlockType="StartupScript" ScriptId="HideFileUpload" RegisterOnce="True">
<script type="text/javascript">
var $lnk = jQuery('#' + FeedbackForm.fuFile + '__lnkNewFile');
var $txt = jQuery('#' + FeedbackForm.fuFile + '__txtFileName');
($txt.val()) ? $lnk.hide() : $lnk.show();
</script>
</ScriptBlock>
This is using jQuery but can be modified to work without it.
What I'm doing is registering this script to appear near the bottom of the page, so it runs after the controls in the form have been created. It is assigning a variable to the "Upload File" link of the control as well as a hidden text box that is used to store the file's name. It then either hides or shows the link based on whether there is a value in the textbox.
Put the power of XMod to work for you today
Purchase XMod from Snowcovered OR
Step Up to the Power and Performance of XMod Pro
You are not authorized to post a reply.
Knowledge Base Information
--Welcome - Read Me First
--Suggestions
--Information for Contributors
--Temporary Holding
XMod
--FAQ
--Solutions
XMod Pro
--FAQ
--Solutions
--Samples and Examples
Forums
>
XMod Pro
>
Samples and Examples
Active Forums 4.1
© 2004-2010 Kelly Ford
|
Privacy Statement
|
Terms Of Use