Detecting Order of Checkbox Selection and Passing along Data V2 - javascript

Im trying to create a page that allows a user to select a maximum of 8 checkboxes out of 25 checkboxes total, While at the same time detecting the exact order the user clicked the checkboxes.
My question is, What code can I add to the javascript to gather this info and pass it along to a page named check_combination.php I have been told that this would be a hidden field, But being a noob Im stuck. Can someone please tell me what code i would need to gather it, and what type of code I would nee to extract it on check_combination.php
Here is an exaple of what I have so far Click Here to test in Real Time at JSFIDDLE
I am a noob to javascript, but I have been able to piece together various snippets of code to get as far as I have. The only thing I am missing is Im not sure how to pass the variables along when a user hits the submit button.

You're already there. After you submit the form the result values will be submitted as well, and you can find them in $_POST['result'] using PHP.

Related

Need to check the value of a field, then display another using a Cleditor form

I apologize in advance, I am trying to do something more advanced than what I was hired for, so my key words, understanding and syntax's will likely be very wrong.
I am setting up a cloud based DBMS that has a custom document creator. I believe they are using cleditor. I need a way on the form to do some sort of If statement. To populate a value from the DB, the tags used are like {Equipment:Manufacturer} and then whatever the value of the field is shows in the form. I need a way to check the value of one of these tags, and then display another field based on that choice.
If I need to clarify anything or have not stated what I a looking for clearly, please let me know so I can learn.
I have tried adding but those get stripped out. I tried something like {Equipment:Manufacturer}==="Manuf" and several variations on that.

In PHP, how can you set a textbox value by clicking text on a page?

I have a page where users can vote for businesses by choosing a category and typing a business name. When they begin typing, the page predicts the business name in a span below the text box.
I want a user to be able to click one of these predicted names and have the name become the value of the text box for submitting. This will ensure consistently correct business names. Ideally, this will happen without having to submit a form or reload the page.
I've seen lots of mentions of jQuery and AJAX but I'd really rather just use PHP in possible. If I have to use a second programming language, let me know.
I apologize if this question isn't very detailed, but I'm new to PHP and still trying to poke around, and I'm picking up on work done by someone else. Also, I'm not looking for blocks of code as answers. If I know the functions I have to use, I should be able to get the rest myself. Thanks SO!
You need some form of JavaScript manipulation for this. It cant be done in PHP alone.

Cant seem to get value of input text fields value into hidden form fields using javascript

So I have a fiddle of the code:
http://codepen.io/databaseindays/pen/JGdgq
The idea is that the user can find their coordinates and then submit them via POST variables in hidden fields in the form.
Im using JQuery to simply read the lat and lang fields value into the hidden fields. But the POST variables are always empty. The values are not being copied.
One theory is that I have the hidden fields inside a FORM, while the inputs im trying to copy are not. So first question is, is that a scope issue? If so, should I omit the Form and submit another way, if that will give me access to the values?
Thanks
Norman
OK, you're probably going to kick yourself when you see this. I know it took me a few minutes before I noticed.
It looks as if you're trying to copy the value in the jQuery block at the bottom of the page. However, that bit of code is only running when the document is ready, and NOT when the geocoding operation takes place.

javascript editing fields after manual edit of field

I've looked everywhere on this.
basically what I have is a script that changes the value of some fields based on a radio selection.
For example: Think of it like a radio button that gets credit card data.
it works initially when the page loads and selects a radio. It will correctly load the data of that radio button.
Now when I choose to edit the fields manually, using it like a "new card" form, if I change my mind and go to select a presaved card, it will no longer update those fields I edited manually. It will completely ignore my request for it to change values via my javascript code that was just previously working. Note: It will actually still continue to work for any fields I left alone *did not manually type into/edit
so I was just wondering who else had that problem and what one does to fix it.
I am not sure if I understand exactly but I'll take a shot. My suggestion would be set apply a css class like "is-dirty" to the field once it has been updated and then you check to see if a given field has that class before updating it.

validation help - using class to make sure one or more of 6 check boxes are clicked

Im totally new at all this and i am trying to do something new to my website (maybe i should pay someone to do it but im trying to learn)
I have had my website created by someone and dont wish to pay them anymore. Basically my form is located here: http://www.eatatmenzies.com.au/sign-up.html
and what i would like to do is make it so one or more of the semester one and semester two checkboxes and checked. Is this something i can do in dreamweaver? I read that i would need to create a group (using the name) however the guuy who built my site has named all my checkboxes and when i change it to make a group the additions dont work anymore, so i created a class called "onerequired". but i still cant get it to work.
any help or being pointed in the right direction would be greatly appreciated.
My answer to this post might be helpful to you, the only difference is here you have to place check script on multiple checkboxes.
The thing you have to do is to just disable your Meal plan Registration button and only enable the button checking the conditions, onclick of any checkboxes.
Optionally in your script function totalcalc() you can check the checkbox value and place required alert returning false.
if(!document.getElementById('chk1').checked or !document.getElementById('chk2').checked or !document.getElementById('chk3').checked){
alert('Please select atleast one meal');
return false;
}

Categories

Resources