I have been trying hard to get the data from the clicked checkboxes using jquery but not able to get data of one variable.
I want to save like for example if i click on 2-3 time and day is monday and when i click on save time sheet it should save these values into database but i am not getting value of time in variable ,but i am getting value of day when i alert it on submit.
Check this link for getting clear idea.
calendar
code
Your issue is this line
$('input').click(function()
It sets your text var when you click on a checkbox, but when you click on your submit button, which is also an input, it overwrites the text value.
Use the :not() selector, so that it does not bind your click function when the input is the select button
$('input:not(#submit)').click(function()
see this jsFiddle example, using :not(#submit) - http://jsfiddle.net/wBNGP/
Related
I need to get a text that the user has select with pointer and put it to some variable in PHP. So, the user should select some text in one div, then click submit button (in another div), and then I need to store that part of the text to some variable. Can anybody help me?
You would have to set an onclick listener (I prefer to use JQuery for this) so that when the user clicks the submit button, you grab the selected text from the div. You could probably do that in a way found here:
Get the Highlighted/Selected text
Since javascript and HTML are front-end and PHP is back-end, you cannot simply place the selected value into a PHP variable. Instead, you can use an ajax request to send the data to a PHP function. I'm not sure what you are doing with it after that, but sending an ajax request and including the selected text in the data section of the request, and then retrieving it in your PHP file/function and storing it in a variable there. This question should help in that regard: Passing Javascript variable to PHP using Ajax
I have the beneath page and when i need to enter another education background so i enter it in a html base.
http://i.stack.imgur.com/6mnA7.jpg
As i am newbie in PHP so i need help in this regard.
I wanted to ask that is there a way to make it dynamic i mean when i click on that plus sign then a form form should come the first row without refreshing the page and by clicking on submit button it should save to database and come to the first row.
Like stackoverflow.com comment section.
You would need to use preventdefault on the event object.
Please check here for further clarification..
m developing a website where you can search for any desired property by providing appropriate inputs. I am also providing a feature where you can take part in online auctioning of a property.
I have provided one input box where you can set your bid and submit for your bid.
on the top of that input box i am displaying the current highest bid which i am fetching from database. If the bid submitted by user is higher than the current highest bid then the line above the input box "Current highest bid is _" should automatically get updated.
But as I have written the logic for fetching and displaying highest bid from database on the top of my page n have implemented the rest of the logic for updating the database at the bottom of the page, m facing few errors,
somebody plz help me
Thanks in advance
If you want to refresh a webpage using php try this
header("Location:http://something/index.php");
Or if you want to get the highest bid from database periodically you will have to use AJAX.
You can refresh your page with the help of JavaScript
location.reload();
there are two ways
1) just submit form to server without any ajax content.(it will be updated and loaded as default behavior)
2)use ajax(jQuery.load or jQuery.ajax will be easiest).
- submit form in the click method of jquery,
- print bid status as the response.
- Catch this response process it and update your data on page.
- to prevent page refresh, use event.preventDefault or return false at end of function
actually i'm new to php & i'm developing a project SIMILAR TO ONLINE EXAMINTAION.
so i'm display questionS RANDOMLY FROM D.B
what the thing is.
i'm displaying 5 questions ALONG WITH THEIR OPTIONS in a single form.
and i selected a radio button from a form & done page refreshing.the selected radio button can visible like unchecked after the page refreshing.so i want to display a radio button as checked which was selected by a user before page refreshing..is it possible.
or can u suggest a code to block the browser refresh button...
Try the sisyphus http://simsalabim.github.com/sisyphus/ - nice and easy to use JQuery plugin
You can store selected values in the cookies using javascript and on load event read cookies back and populate the values back.
So I have a unique dialog box opening which a click a button. Inside the dialog box, I have a data table (which is preloaded when the original page is loaded). Now what I want to do is to change a cell text when the user clicks a buttton in the jquery dialog. I gave the cell a unique id and everything, but for some reason I cant update the text in the cell from the call back in javascript. I have been able to do it without the dialog, but for some reason I cant do it in the dialog. Does anyone know why? The simple javascript im using is
document.getElementById('boldStuff_' id).innerHTML = 'gasgsadg';
It should be:
document.getElementById('boldStuff_' + id).innerHTML = 'gasgsadg';
Notice the missing "+" which is used in this instance to concatenate the string with the value of id.
Okay so there is the answer in case other people are having the same issue. Okay so basically all the popups are being written to the DOM, nd thus i was using the same ID for the rows in each popup. All i did was add a second identifier:
$('#groups_check_'+result[i]+'_'+grppk).addClass('ui-icon ui-icon-check');