Is that possible to populate the field content of filefield to the other field right after the file had been uploaded and before hit save? If yes, how???

Thanks in advance.

Comments

quicksketch’s picture

Could you provide a more specific scenario? I'm not sure what you mean by "populate the field content of filefield to the other field". What's "the other field" in this example?

happydrupal’s picture

We use Drupal for Video Gallery. Basically most of the video will upload to YouTube. However, some user refused YouTube and prefer the direct play by Drupal. So we create a video node with 2 CCK field:
1) filefiled: for video file upload
2) emfield: use YouTube or custom URL for Video Display

For those who willing to use YouTube service, Drupal then create another node with Video Upload field for upload Video to Drupal after the editor review. Once successful, the YouTube Link will be write back to the emfield of the original video node. For the who refused YouTube just keep the Video at Drupal. So the video node can play both YouTube Video or Local Video with emfield.

Our problem is.....User tend to upload the file with filefiled only, forget to past the Video URL to the emfield manually everytime. However, we can use some PHP code in the default value of emfield, but the return array was very complicated. If there's a way to automatically fill the URL in emfield (or simulate the user past URL) for user, that will be great and simple, I think.

Thanks in advance.

happydrupal’s picture

Status: Active » Closed (fixed)

Thanks, Already find the solution using Drupal.behaviors in #555516: What's the jQuery event when the wrapper got replaced after the file uploaded???