Email submission form with attachments (add, open, and remove) in spring mvc - email

How can I create a email form which allows user to specify:
To
Subject
Attachments with Add/Open/Remove facility
send/cancel button
I'm having trouble to send the index of the file the user want to remove , for example if the user attached file1, file2, and file3 in the email submission form and I captured this info in the controller as key,value pair where key is index and value as file name. But the user is allowed to remove arbitrary file before sending the email, for example the user clicks 'file2' remove button. Now in the controller I want to grab the index of the file need to be removed, but this is dynamic since user can click any of the attached files remove button.
I'm using spring 2.5 with JSP/JSTL as view component.
Please see the sample email form:
To |_________________|
Subject |________________|
Attachments: [**ADD**]
**X** file1
**X** file2
**X** file3
(click the 'ADD' button to attach file, click 'X' to remove corresponding attached file,click on the file name to view/open the file contents)

If removing is handled at the server side, you can implement remove buttons as a <button> tag, where name is, say, fileToRemove and value is an index of the file. When user click that button, the form is submitted with fileToRemove=... parameter:
<button name = "fileToRemove" value = "${file.id}">Remove</button>

Thanks Axtavt, but we are using IE6 as client browser and the following is known issue:
Meanwhile, the button element allows authors to produce buttons that submit data to the server that does not match the text displayed on the button. Delete should submit to the server row_to_delete=1 but Internet Explorer will send row_to_delete=Delete. If IE could be persuaded to behave, then this would also be useful for multilingual sites – the text displayed could be translated for each language, but the value could remain the same so the server side logic wouldn’t need to check the translation table.
It gets worse though, Internet Explorer 6 has a further bug where it will treat all elements as successful controls, and submit their data to the server, even if they were not clicked. This effectively makes using multiple button elements impossible.

Related

MS-Access Database will not export into email with proper form name

I am working on a Database in MS Access. The database has multiple forms within it. Currently, I have an action button that saves the open form as a PDF and attaches it in an email (email has auto-populated "to" line and "subject" line). Many of the forms in this DB need to be saved as PDF and sent via email.
The PDF attaches and the email opens properly, however, the PDF filename is not titled properly. It has a name from another form's attach button function (same email-sending button type, different form).
I did a little digging, and I noticed that when I change the view type to "Design View", the proper title appears:
.
When I am in any other view, it shows the incorrect title:
I've attached the email view where the PDF attached should say Scrap at TRM.
I've also attached the macro that the button runs:

Needing to have a form in every instance of a content type that can be submitted once per node - Drupal 7

So here's the situation and I cannot figure out how to accomplish it.
I have a content type called "Alert". Each instance of this content type needs to have a webform (really just a submit button with hidden fields), that users click to acknowledge they have read and understand the alert. Ideally once submitted, the form should be replaced with a message along the lines of "You have marked this alert as read."
I do have a webform created (displaying as a block to be able to place within the variant page set up for the Alert type) and can get it to appear on each instance, but users can submit multiple times on each alert (submissions are set to unlimited as if i set it to 1 submission per user, the form does not render after the first submission on any alert). Additionally, once they click on one instance of the form, every additional instance will result in a message stating they have already submitted the form.
So I really have two issues. First, and most importanlty, allow a single submission per node (without the "already submitted" notice). Second, not required but would be nice, once it has been submitted for a specific node, the form no longer renders on that node for that particular user. Anyone have any ideas on the best way to accomplish these two aspects?
I'm running on Drupal 7.56, using the AT_Panels_Everywhere theme, Webform module Version: 7.x-4.15.
In drupal 7, with webform 7.x-4.0, you can enable webforms within a content type. To do so:
Go to Structure > Content Types
[Respective content type] > Edit
In the bottom left section, find the Webforms Tab and choose Enable webforms for this content type.
Based on your use case, I'd recommend enabling that and installing the node clone module. Then you can make one alert node, setup the webform, limited to one submission per user and allow content managers to clone content. That node can serve as a template.

Load data saved in form on a new form

I need to use Orbeon Forms to create a form to capture the price from a number of things. I create a form, connect it with database (MySQL), deploy the form, complete the form, and it saves the data correctly in database.
Then my question is: if I complete form_1 and save the data in the database, and later enter to the empty form_1:
Is it possible to load the data entered previously or from the last form completion for form_1?
Is it necessary to have button or any control to take an action?
When you load a page to fill a new form, notice how the URL ends with /new. When you are on that page, and save, notice how the URL changes to /edit/123 (where 123 is a long unique identifier). You can come back to edit the data by loading again this URL.
In practice, this is often done by going to the /summary page for the form, and clicking on the relevant form data you want to edit.

How to store text from field with Google Tag Manager on a form submission

I'm trying to catch email address as a variable with Google Tag Manager (GTM) on signup form submit on http://cloud.feedgee.com/ru/signup and fire a tag with it. On submit, the page is being reloaded.
By now tried to catch it with Form submission by form id set as shown on screenshot) and a Button click as a Custom event with it's click id
I initiated a DOM element variable with Id of the Form text field (Element Id=ContentPlace_loginEmail)
With these settings in Preview mode on Form Submit, I can not see my Tag in "Tags Fired On This Page" row before page reload.
What can be the reasons for this if Id's of the elements are correct?
May it depend on the container script location on the page?
Now It's located right after the HTML tag.
Can I store form text field in a DOM variable to use it in the tag?
If you want to store the email value in your own API, Google Tag Manager is not the right tool for you. You should only use it to track events that fit under Google's terms of use.
Having said that, when you're working with forms in GTM, hold the <shift> key with you click the submit button. If you do that, a new tab will open up, but the current page wont get redirected or refresh. You'll then be able to see what data is being pushed to the dataLayer.

Blue Imps jQuery file upload send files with form like normal field

Is it possible to send file with form as normal file upload? When I check a file field it is always empty, and I need to send it with form data in one call. IS that possible?
There might be better answers out there, but I ended up solving this by following steps.
Having 2 forms on the page. One for file upload and one for other form data.
Format both forms using CSS so that user gets look and feel of one form.
Have only one div (which looks like button) to submit. Hide the actual form's submit button, if you are using them (I don't. Because I preprocess data and then send by ajax)
Once user submits forms (by clicking the dummy button), Using JS programatically click the file upload button.
Optional Once that call is finished, if there are no errors only then continue.
Submit the form with other form data.
The advantage I had in this approach was that I could have more control over user's form data as well as my file upload's settings. Because I had some settings (like max number of files and max file size) were dependent on user's form entry.