Drop down list with submit - wordpress

Very basic question here. I'm trying to make a simple form that includes a dropdown list and a submit button, with each dropdown item corresponding to a pdf file. The user must simply select an item and click "submit" and the file will download.
I accomplished this by adding an onClick event to the submit button. HOWEVER, WordPress strips out onClick events. How do I accomplish this in the simplest way in a WordPress site? Thank you!

The simplest method would be to hard code your form into a page template in your theme. Here is a great resource for creating custom page templates: https://www.smashingmagazine.com/2015/06/wordpress-custom-page-templates/
If the code is added to the template, then the onClick will not be stripped out.

Related

How to open new form when click on button in CF7?

I created a form using contact form 7. In that form two buttons are there. When you click on submit button it will execute the current created form. What I want is, when I click on another button, it should display another form take 2-3 fields with submit button.
It's not completely clear what exatly you're trying to achieve.
do you want the second form to show on the same page, or you want it to be on another page (meaning a click on second button will redirect the user)?
If you want to redirect to another page with a new form, you can just use:
[submit "Submit this form"]
<button href="http://example.com/path_to_other_form">Open the other form</button>
Please note that generally including two buttons is a bad practice.
Why not using a normal link for the second form?...
Contact Form 7 only supports a single Submit button ( as per standard HTML forms).
To add a second active button you would need to use custom Javascript.

Dynamic drop down list based on a textfield

How can I populate the content of a dropdown list dynamically using a text field in ASP.NET?
I do use the Ajax Control Toolkit for all Ajax calls so far.
My Page looks like this:
I have a Modal Popup with a textfield (Autocomplete) and a dropdown list.
The content of the dropdown list should now be populated according to what was selected in the first textfield. The data can be gathered using a webservice or directly in the database. The queries are existing and working.
The issue that I've is, that the ParentControlID="textField1" of the ajaxToolkit:CascadingDropDown can't be a text field.
Is there a better way to solve this issue? Is there even a way without writing the Javascript code by myself?
Why don't you try doing this with Jquery?
Here is a example for the same
http://geekswithblogs.net/michelotti/archive/2008/06/28/mvc-json---jsonresult-and-jquery.aspx
More helpful link
Dynamically populate the drop-down using jQuery in ASP.Net MVC3
http://forum.jquery.com/topic/populate-a-2nd-dropdown-from-the-choice-of-the-first-dropdown

post asp.net form

I have an aspx page. In tag i wrote action property to some url.
There is a submit button, when i press it the page is submitted. This is quite simple....
But what i will do when i have to submit that page to three different URLs upon pressing three different submit buttons? How would i handle the action property of tag for three different URLs. Can i submit form from server side?(I mean by changing action property of form dynamically).
I am new to asp.net please help me as soon as possible.
I will be thankful to you...
take a look at the PostBackUrl-Property as explained here:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.postbackurl.aspx

Prevent Postback in array of linkbutton is created at dynamically

i have created Array of Linkbutton
and when user click on link button it will create an array of Radio Buttons
but it requires Postback all time so page load takes more time...
what is solution of it??
Use asp.net Ajax update panel.
Put link buttons and panel/view (or what ever control you are using ) update panel.
I am not sure if I am following a 100% but if you don't want to do a post back then your going to need to write some javascript(or use a framework like jquery) to generate radio buttons when the user clicks the link button(plus you probably don't want to use a link button then as it will try to always cause a postback or you will need to stop the post back from happening).

Drupal forms with WYSIWYG and AHAH

I'm trying to have an AHAH-enabled form with WYSIWYG fields in Drupal 6.
Problem
On this custom form, the user can click a button to add new fieldsets and add fieldsets within those fieldsets (so there is a parent-child nesting situation within the form). The addition and removal of fieldsets is handled via AHAH (and the ahah_helper module). Each of the parent and child fieldsets contain two fields which are text areas replaced by a WYSIWYG editor (with the Wysiwyg module using NicEdit 0.9). The problem is that on any AHAH submit, changes to any of the WYSIWYG fields are ignored. It appears as though the changes to the scripted field are not populated back to the HTML fields before submit, so the original value gets posted.
What I've Tried
My first thought for a solution was when the user clicks any of the AHAH buttons, simply remove all of the WYSIWYG fields with their native functionality. The two approaches I've tried haven't worked.
I can't add a click handler to the AHAH buttons themselves. An AHAH submit can add more such buttons, so I'd need a client-side callback function to bind the function on any new buttons. But I can't do that because Drupal doesn't let me modify or add to the client-side callback.
I can't add a click handler to the form container and let the events bubble up because the submit buttons interrupt event bubbling.
I ran into this same problem. Installing the WYSIWYG CCK Integration module solved if for me.
http://drupal.org/project/wysiwygcck

Resources