Add image to DB from Telerik upload control - telerik-mvc

I am using MVC3 with telerik controls
I have a situation where I need to add image to DB on click of register/update button in my screen.
I am using the following code to do so.
<fieldset class="fieldsetattachment">
<legend>#Html.LabelFor(model => model.Image)</legend>
<div class="editor-field">
#(Html.Telerik().Upload()
.Name("attachments")
.Multiple(false)
.Async(async => async
.AutoUpload(false)
.Save("Create","Employee")
)
)
</div>
The issue is that I need to start the upload process when the create button on the screen is pressed and not when the upload button on the telerik upload is pressed.
Also I want to hide the upload button from telerik.
Any help is much appreciated

Y0,
Since there is not API which allow you to call the submit file with JavaScript you can hide the button like this on document ready:
$('.t-upload-selected').hide();
And when your custom button is clicked to submit your form you need to trigger the click programatically.
$('.t-upload-selected').click();
Of course if you have several upload widgets on the page you will need to be more concrete with the selectors.

Related

How to add an event handler to a button in a third party form component

I've got a Gatsby site that uses a handful of plugins and third-party components. The component in question is a form built with react-hubspot-form. Hubspot sends raw HTML which I'm able to style with CSS. There are two potential hangups I've got with this, both of which deal with targeting specific elements in that form.
I'm looking to add Google Analytics to the submit button to track clicks. I've thought about wrapping the component and adding an onClick to the parent, but this would track clicks anywhere on the form, not just the submit button. I'm currently trying to incorporate ReactGA.
The second issue is updating state when a user selects a radio button. I need to dynamically update a url based on which radio button the user selects and cannot currently figure out how to do that.
<HubspotForm
portalId='PORTAL_ID'
formId='FORM_ID'
redirectUrl={`URL_WITH_PROPS_TO_DYNAMICALLY_UPDATE_LENDER_CODE=${props.lenderCode}`}
submitButtonClass='loanAppSubmitBtn'
cssClass='program-apply'
onSubmit={()=>{
ReactGA.event({
category: 'Apply Now Button',
action: 'click',
label: 'form submission'
})
console.log("clicked hidden button")
}}
/>
When I tried putting a function for onSubmit, the console said I needed to use jQuery.

Create button in C# winform like IDM buttons

Did you see the first page of IDM (Internet Download Manager)??
IDM first form
Now i'm trying to build some buttons like these buttons(above picture) but I don't know how I must start? Is there any software for it? These buttons change their mode when hover mouse on them.
Have nice day
Start with a ToolStrip control and add a Button to it using the DropDown control on it. Change the DisplayStyle to ImageAndText, and TextImageRelation to ImageAboveText. Now change the Image property to your Icon image, and ImageScaling to None.
On the ToolStrip itself, change GripStyle to Hidden.

WinForm button click methods are being renewed. with button onclick_1

I just finished completing my winforms app. Suddenly when I was changing background color of gridview. When I started my app for final tests the buttons were not working. I checked their on click code and it was correct. Then I double clicked the button it created new button onClick_1 method. SO now all the buttons are doing it :( I dont' know what to do. Please help
Looks like your events are no longer coupled to your code.
Do this for each of your buttons:
Open your designer
Click on your button
Open your properties tab
In this menu, click on the events button
You'll find your "Click" event.
Click on the arrow and select the correct event.

How to show custom button on custom objects?

I have one custom object Named Itnery and i created one custom button Named Save and in page layout under custom button section i drag the button there but it not shown in the Itnery window when i opened it.Itnery section comes with Opportunity window.
Second thing is i want to save the data related to Itnery like email,from,to etc on button click as i created and i did it as under:
{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")}
Itinerary obj= new Itinerary;
obj.Email_Content_c = {!Itinerary_c.Email_Content__c};
obj.Email_Subject_c={!Itinerary_c.Email_Subject__c};
obj.Email_To_c={!Itinerary_c.Email_To__c};
obj.Flight_Info_c={!Itinerary_c.Flight_Info_c};
obj. Itinerary_c={!Itinerary_c.Itinerary_c};
obj.Opportunity_c={!Itinerary_c.Opportunity__c};
Database.update(obj);
message ='Saved Successfully';
window.location.reload();
Behavior: execute javascript
Content Source " Onclick javascript
please let me knw if anythng wrong in the code also..as i am new to saleforce
Thanks
I think you want to add your custom "Save" button to the related list.
Do it like this:
- at the Opportunity layout page click on "Edit layout" link
- then scroll down to related list (Itnery)
- click on the tool icon
- in the popup window you will see the settings of the related list
- there are "Columns" and "Buttons" areas, click on "Buttons"
- there are standard and custom buttons: select your custom button and click on the "Add" button
- save you settings

How to interact with other application forms

I am looking for a way to once I see a form by Name add a button to that form and when the user clicks the added button, pull information from the form. For example, if I see the for title - "Stack Overflow - Wnidows Internet Explorer" I would add a button "MyButton" on the form, and when that button is clicked, I would "pull" the information from the "search" box. It should work on Web or Win forms.
Any help would be greatly appreicated.
I found my answer
You need to get the window handle to the form in question.
To put the button on another form you need to create the button and set its owner to the other window and set the buttons window position.
You can use the same window handle to enumerate the child windows to get the text if its an edit control.

Resources