close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

File fields and Data Bridge Update Record

Thread began 10/17/2013 10:57 am by davegw | Last modified 10/22/2013 4:06 pm by Jason Byrnes | 945 views | 11 replies |

davegw

File fields and Data Bridge Update Record

Just following your Digital File Pro tutorial: "Add file fields to Data Bridge insert / update pages"
I''m having trouble with the Update page section where a hidden field is placed next to the actual file field.
The hidden field is used to display the current filename in the file input box, not so?
What input ID do you use for the hidden field? Doesn't the ID have to be unique?

Everything else works except for this. My workaround is to echo the filename from the recordset under the form field if the filename exists.
Also Firefox & Chrome hide the text field next to the browse button - what happens in this case?

Sign in to reply to this post

Jason ByrnesWebAssist

a file field cannot be given a value.

on the update page, if a file has already been uploaded, the hidden filed should hold the file name from the database.

the hidden field is used when no new file is uploaded. it is used so that the original file name is not removed.

the hidden field should be bound to the file name column fgrom your recordset.

in the upload file behavior, bind the default file name setting to the hidden field.

this was, if no new file is selected the server file name variable will be populated with the original file name from the hidden field.

if a new file is selected, the server file name variable will be populated with the new file name and stored in the database.

Chrome and fire fox wont display the text box that holds selected file name, but that is only visual, the file will still be sent as part of the form.

Sign in to reply to this post

davegw

Thanks Jason
How do you name (id) the hidden field that corresponds to the file field?
I know the file field does not get a value, but it needs an id.
Perhaps you could send me some example code for the hidden & file field pair.

Cheers
Dave

Sign in to reply to this post

Jason ByrnesWebAssist

I usually use the name of the file field for the ID

the name can really be anything you like as long as it conforms to javascript variable naming rules:
-Only letters and numbers can be used
-The only exception is the underscore
-the first character must be a letter

you could use:
productImage

for the file field name and ID

and then use:
originalProductImage

for the name and ID of the hidden element.

Sign in to reply to this post

davegw

Thanks Jason - that was quick!
Now I see - the binding is the key.
As long as you bind the hidden field to the file field name, it does not matter what you name the hidden field.
Cheers
Dave

Sign in to reply to this post

Jason ByrnesWebAssist

Originally Said By: davegw
  Thanks Jason - that was quick!
Now I see - the binding is the key.
As long as you bind the hidden field to the file field name, it does not matter what you name the hidden field.
Cheers
Dave  



Yes, that is correct. the name is not really important as long as it is properly bound.

Sign in to reply to this post

davegw

Hi Jason - there are 5 file upload fields for documents on a form using WA Update Record. (The record already exists)
The files upload & the filenames inserted in the table in the first update, but if I do a subsequent update , it removes all the previous filenames, then adds the current one. However if I upload using only one of the file fields, then upload another file to the SAME field, then it replaces the filename.

Any ideas?

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the page.

Sign in to reply to this post

davegw

Here we go Jason

Sign in to reply to this post

Jason ByrnesWebAssist

each of your hidden form elements needs to have the value bound to the corresponding column from the recordset.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...