I looked for answers, but I am a newbie to PhP/JQuery so the answers I found confused me further.
I have a wordpress website that contains a form with a date selector field I am trying to determine when the user selects a new date and save that date to a variable to be used somwhere else
On change doesn't work cause of the lack of focus etc...
I tried select, and that didn't do anything
In the process of trying to figur eout what I am doing wrong, I simplified the code where once it is selected it gives me a message box! the code is below:
Any help is greatly appreciated!
$JScript ="<script>
jQuery('#wdform_2_element13').on('select',function()
{
alert('Here');
}
</script>"
You can stop the process when your saving all your data from the form, and call a new function to save or do whatever you want to that variable.
You can do that by pointing your form submissions to a specific file in the wp-admin directory called admin-post.php
Take a look to this tutorial and I'm sure you will learn some basic knowledge about WP code and also the answer to your question:
https://www.sitepoint.com/handling-post-requests-the-wordpress-way/
It turns out the reason is cause the field was a date picker that was already defined through the form maker i was using. So what I did was create a date picker using Jquery, then use the "onSelect:function" and that was it
Thanks for the help
Related
I had a question about a tutorial that I saw on sitepoint.com
http://www.sitepoint.com/building-multi-page-wizard-like-form-drupal/
I've got everything in the custom module and now I need to know how to go about actually creating the user using this form.
There's a multipageform_form1_submit code where it says //Store the values from $finalformvalues in database or file etc
What am I to do to actually create a new user? I'm sure there's a little snippet of code that needs to get added but I have looked and looked and cannot seem to find what I need. Any help would be greatly appreciated. Thanks in advance.
To add a new user, just use the user functions in your hook submit. See this article for code examples.
I've been basically following the joomla guide for a front end form, but I'm having trouble understanding how to keep my form view once submitted. I'm getting data back, but it's from my controller and just replaces the form. This isn't a DB update, it's pulling data from an API that should be shown below the form... but I don't see how to do that based on the guide.
Sorry, I feel like this is a dumb question, I'm just not used to MVC yet. Maybe someone can point out a better guide for this?
Nevermind, I figured out a way around it. I'm using JQuery to get the results in a div.
Hi I want to add an autocomplete input field in limesurvey but don't know hot accomplish this task. Any one know where to add code for add custom input field?
in autocomplete.js
In this file the code that call a php function on the base of keyup in input field.
in checkInDb.php
In this file the code check term that come from **autocomplete.js** and search in database then send response back to js file
Where to add this code?
In the LimeSurvey documentation it explains very well how to modify the surveys with Javascript.
You don't explain too much, but I think you can find the solution here.
I have been trying to create a php form that allows you do add your employment history. I wanted it to work with javascript to add new fields such as in this link: jsfiddle.net/jaredwilli/tZPg4/4/, but with drop down lists to add a start date and end date, and then be able to POST this to php.
I am a newbie to javascript and am in need of help with this code if possible.
Thank you in advance
Am I correct in understanding that you want to add a date picker to your existing input?
If that's the case, and seeing how you're already using jQuery, you should check out jQueryUI which has a Datepicker module with great documentation.
i use jQuery datepicker. i disabled input text and wanted use it as simple calendar
http://jqueryui.com/demos/datepicker/#inline
but now i need to make it with php and mysql, so as retrieve news from database on selected date. for instance when admin adds news on 2011-07-07 i want to link this day on calendar. sorry for my bad english but if u understood please help, i really found lots of documentations but couldn't did.
i used
onselect
also
beforeShowDay
but cannot understand. is there any chance to make it like news calendar?
help me with a small code please...
Use setDate.
$('...').datepicker('setDate', date object);
you can use the before show function of the date field to call a location.
$('input.dateSelect').datepicker();
then have a button that follows the input
[ get news ]
javascript function
...
window.location.href = "www.foo.com/news.php?date="+$('.dateSelect').val();
...
There is one of several ways to skin this cat, and not necessarily the best.
I hope this helps someone else with the same issues!
bo huttinger