|
|
Register
|
Login
Home
Products
XMod Pro
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
Testify!
Development Services
Support
Forums
Knowledge Base
Training
Blog
Contact
»
Support
>
Knowledge Base
Thursday, September 02, 2010
What's New
[XMod]
Ratings on xmod template
[XMod Pro]
How Do I Use Tokens in A Select/Submit Command?
[XMod]
How to add automatic numbering
[XMod Pro]
Interpreting "Databinding Methods such as Eval() ..." Error Messages
[XMod]
How Do I Post to Salesforce?
[XMod Pro]
Can I Use The Module With All My Portals?
[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
Home
Products
XMod Pro
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
Testify!
Development Services
Support
Forums
Knowledge Base
Training
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:5800
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.
Power Your Website With XMod Pro
Buy XMod Pro Today
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