How can change the Element Label in a form using js function?

Hi there, so I created a workaround for the problem to cancel a FileUpload!!,

I added a button for each FileUpload field I have and wrote a .js to ajax_function which calls an update query to replace the filename with a blank ('')

This actually works!!!

Now I want to let the oke know what is happening but I do not want to add a FileName element for each one again.

Now I want to manipulate the button's Label to indicate whether a file is attached or not.

How do I update the Label of an ELement using js?

form_X.formElements.get('tablename___cost').update(t);
 
I had to look up the word 'oke' which apparently is a South African phrase for person, is that correct? :)

So am I right in assuming this is the ajax fileuploader and you want to delete a file that is updated before you save the form? I guess somehow relating to your other post.
 
You are right! Oke is like chap or dude ...

Yes it is related. I decided to put my chips on black and red take a chance that maybe one thread will be answered.

Like before I am really battling and am maybe stretching the limits of my knowledge by trying something maybe outside of my league, but if i cannot do this I will have a bit of a half-baked solution if a user has no way of cancelling an upload

The problem is that once a file is uploaded and you get into the edit screen the fileupload still shows "no file chosen"?
In my other thread
My plan is to read the fileupload name and display it as the label on the button that will provide the ability to cancel it. SO I would like to change the label on the load and change actions to "Cancel :" & $Filename & "?" (VB pseudocode) to show the use on the button [Cancel \2012\supplier1\2012uifcerticiate.pdf ?]
 
Can you expand a little on:

The problem is that once a file is uploaded and you get into the edit screen the fileupload still shows "no file chosen"?

And can you give me the URL to your other thread.

-- hugh
 
Added the screen dump

Hi Hugh, I have attached a combined screenshot to illustrate the problem.

I upload a dummy UIF Certificate (Unemployment Insurance Registration Certificate) and you can actually see it in the list.
When you now Edit/Open the record you would think that you have not actually uploaded anything, hence my attemp to actually use the Button Label to show the name of the file.
I could use an additional character Field but with the buttons (which is a desperate Cancel Upload workaround anyway) and all the form will become too cluttered with all the workaround fields ...

The link to the other thread is:

http://fabrikar.com/forums/showthread.php?t=29742
 

Attachments

  • FileUploadIssue.JPG
    FileUploadIssue.JPG
    117 KB · Views: 281
That issue shoudl be fixed now, on your screenshot you will see the work 'Array' above the upload. That should show the filename and will work again if you update to the latest Github.

On your other thread I thought you were refercencing the ajax upload. Are you using both?
 
Thanks,
1. I'll do a quick upgrade and check (hope it does not break something else now?)
2. No I changed to Ajax upload but that from a form real estate point of view takes up too much space and does not look slick...On top of that I only need to allow them a single file upload anyway.
 
Status Update
08:02 South African Time - Upgraded to 406 this morning and still no "Array" anymore on File upload element bur also not filename as well....

Just an observation if it will help,
when "array" was displayed it was on the same row as the Label and the "Choose File" button and "No File Chosen" was on the row below.

Now that the "Array" is not displayed the "Choose File" button and "No File Chosen" have moved up and is now on the same row as the Label.

Could it be that it DID write the filename but the button etc was not forced to the row below?
 
Hi there, now sitting on version .416 but still no array Array and no filename

Please help/fix or at least tell me how I can change a label, then I can at least try and put band-aid on to move forward.

Just a personal note to vent my frustration.

There are now so many small issues that I am beginning to be very sorry that I started on this path. My users have seen the potential and are very excited and cannot wait for me to deliver but I feel I am not even fighting my own Fabrik/Java/PHP learning curve but the inherent problems/instability of this application is now fighting back and really starting to compromise my reputation as someone who could deliver in the past.

To the Fabrik guys, would upgrading my support to Silver improve the response at all?
 
Are you toggling between setting the fileupload element to use ajax/mutliple file uploads and the normal fileupload? This might cause issues as the data is not stored in the same format.

I tested with a new fileupload element and things work for me.

Here's a copy of my settings:
http://screencast.com/t/zYJqBNWzG8
http://screencast.com/t/ZqHsup4sVgS0


Please help/fix or at least tell me how I can change a label,
Im not sure how this relates to 'changing a label though?

Do you really mean a label? As in the text that appears NEXT to the input? E.g. from your screen shot 'UF Certifcate'

If you don't mean that and what I think you mean, is that you want to change the VALUE of the fileupload element, then sorry you're out of luck. All modern browsers block you performing any Javascript action on fileupload element values for security reasons. Otherwise you could write malicious scripts to secretly upload random files from the users computer. In which case its not a fabrik issue we can deal with.

If you are starting to do custom JS code, and are not familiar with the ins and outs of how js works and then are expecting us to support you through that then yes a silver subscription would be better. You get priority replies and more in depth answers/help.
 
Hi Rob, thanks for responding.

1. Yes, I mean the text that appears next to the input.
2. The REAL question is how can I change the Label (text ON a button)

3. I am not toggling between Ajax and Normal. I did switch until I understood what each did but have for a while settled on Normal as Ajax takes up too much space and looks a little messy for what I need now. In addition I need to limit them to one document per fileupload field anyway.

4. The real reason is I have prepared a little workaround to "cancel" the fileupload. I WAS told that that does not exist (yet) and I have to live with that and accept that.

Part of the workaround is the requirement to actually show the user in the edit screen that a fileupload actually exist already. At one stage there was and "array" next to the label and below that the "Select File". Felixkat in one of my screens where I tried to explain this indicated that instead of the "array" there should actually have been the filename which would have made it clear that a file already exist for that object.

In between one of the myriad of github upgrades even the array now disapeared and all that remains is the "Select file bit".

I have 5 different fileuploads on the one table and if the user does not upload them in one go, (which is quite/very possible,as they will upload them as they source and convert/scan the documents to pdf) they need to see which ones they have already uploaded. I did understand and accept the security issue and am not insisiting/asking for anything that has been justified for me)

I do not want to repeat my whole story but I have added a "Cancel Button" for which I have already developed some basic php update query code to blank out the field. This will only work If I can provide information for the user what has(or not) been uploaded so far and the system as it is in 440 does not show that in an edit screen). I have asked for the php syntax to delete the pysical file as well, but that is only a question that will help me do something new (for me) and if push comes to shove I will use the generic info I have found on other sites to try something. I just thought by asking I could maybe play it a little bit safe as all the caveats around file deletion syntax mentions you can potentially delete the whole folder by mistake. however THAT syntax I accept is stricly speaking not part of the service you provide for my E50 and I accept that as well but thought that someone will share their knowledge with me as the field already contains the folder and file information and if I read that I could then hopefully delete the file as well. I will hunt until I figure that out and will most certainly not hold it against you If my development skills is not up to scratch. (yet). I will build up the courage to put that in (after having backed up my system)

I do believe sincerely though and upon reflection think that 70-80% of my issues relates to bugs issues in the system

Being a developer myself and being in charge of a bunch of developers (mostly SAP ABAP and VB/VBA automation stuff) I do understand that there is always a risk that if you touch code that it could potentially affect other things.

HOWEVER this instability IS making my life very difficult as in the beginning I believed it was me not understanding the coding but in fact trying to find answers in very thin documentation is affecting my productivity ...

Just before you think I am just griping I want to say that FABRIK is a very exciting product and is opening up huge possibilities for me and I want to in the same breath congratulate you for a visionary product.

JUST SAYING .....

If the support required moves to custom stuff and you are willing to provide some advise then I have no problem in moving to silver just to get this job done.
 
Hi Rob,

So I have just upgraded to Silver in an attempt to hopefully fast-track some of the issues. I will really not insist on this being an Computer Based Training tack but really just to get my bugs/problems with the system sorted

Your PayPal payment was succesfully processed. The PayPal transaction id was 8ED19415F9980880M

Please check and advise what do I do next.
Do we manage my outstanding threads in the Bronze. Must I now log (I assume yes) new issues in the silver section?
 
Hi Rob, Hugh helped me my other issues but the delete fileupload is now still there.
He sent me a screenshot where there is a delete button in the simple upload object.
On mine there is none although I am on 453

On his example it shows a thumbnail but in my scenario the uploads with be pdf files.
will the name of the pdf file be displayed on the edit screen so that the user can see if/what is there?
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top