PHP saving and re fetching checkbox values [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am an electronic engineering student. I have a doubt concerning Web development. I have to make a web site for doctors to enter patients data. Most of the data are in check box format. My question is regarding saving and re fetching check box status from the data base, so that the user can see what all are checked previously and what all are not checked when he log's in back the next time.
And also how can i replace the check-box status in database if i change the status. I searched about this in internet but there is no much data concerning this. So if anyone could guide me or give me a link or example codes where i can look and study, it will be a great help for me.

You can save the values of a particular check box in many different way and there are tons of resources online for this, I am sure you have come accross this information before.
You could save your check box values as a string with a string delimiter, for example: A-B-C-D-E. This was you can split/explode the string whenever you need to retrieve the values again as an array and appropriately mark the corresponding check boxes once they sign in again.
Some Resources: http://www.html-form-guide.com/php-form/php-form-checkbox.html
send checkbox value in PHP form

Related

It's possible to record leads analytics about "Source", "Medium" and "Campaign" on a Custom HTML Form? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I know that this question is kinda weird but I have a CRM platform integrated with a MySQL database.
In this way, each new row in the MySQL database is a lead in the CRM system but now I need to track all information related with source, ect... from that lead and seems like a complicated task but don't really know if is possible.
I have hours looking for a solution and still haven't found anything useful.
You have to replicate programmatically what Google Analytics do and save value in cookie or database.
For example, when user lands on website with UTM in the URL you can get that values, if there aren't UTM you can check if there is gclid parameter in the URL so it will be google / cpc, if there isn't that parameter you can check document referral, if it is google.com your source and medium will be google / organic, alternatively website / referral.
You save the data the first time and pass it in the form. This is the principle makes use of.

How to make the search function on a website [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I was just wondering how do I make my website preview some info after the user searches for something stored in the database.
Basic approach for previewing user names as you type in a search bar. For this to work, you will need to use AJAX to query the server and also display the result as a preview for the user to click on if they want, without having to refresh the page.
User types 'Joe' into the search bar
The onChange() even is fired and you query your server with that the user has written "Joe". Keep in mind this query is via AJAX, so as not to force the page to reload.
Server side, you do a MySQL lookup of the table users, where the name is something like "Joe". SELECT NAME FROM USERS WHERE NAME LIKE '%what_you_sent_on_AJAX_request%' LIMIT 10;
The browser receives the response from the AJAX request and displays a nice dropdown with the output of the server. When the user actually click son this "previews" it is in that moment that you would actually reload to the page or take the user to a new page based on what they have clicked on.
That's a very basic approach for it.

Browsing a database as the user is typing [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
This is probably a simple question, but I'm struggling with this.
Basically, how to browse in a database, as the user is typing something?
For example, in a website such as https://www.doesthedogdie.com/, how do they do it to show all the movies beggining with the string of characters you're typing, as you're typing it?
I guess javascript is involved?
It's called autocomplete
Please do some googling next time yourself.
You can use jQuery autocomplete or Bootstrap typeahead to achieve this.
Hope this helps
My personal preference on how to make these kind of systems is fairly awkward, yet it seems to work just fine for me without requiring too much client-side scripting.I use ASP.NET's Page_Load event to save all content in a SQL database into an XML file. Then, when the user enters some text into the field, I make a hidden div class underneath it unhidden to display filtered results from the XML document. This way, you can update the SQL database at any time fairly simply to add new records which should be listed on the website.This is server-side scripting, which I prefer to client-side because the user can disable features and mess around with it to view your code which is something I personally hate.I hope this helps you somewhat.

boostrap hide/show buttons based on variable [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm (trying) to build an app based on boostrap/javascript/ and a nosql DB
a sort of small CRM/invoicing system
i need to show/hide button based on variable
for example for a quote, status could be "open", "lost" "win"
so on my quote details page when status of quote is open i want to show button
- win (who change status of quote id in db to win and copy quote to an order)
- lost (who change status of quote id in db)
but i want to hide button "Re-open" who change a cancel status to open
and so on for my different status..
so want i'm looking for is a way to collapse/hide some button depending of the status of my quote (i put the status of my quote in a variable called quoteStatus)
any suggestion will be welcome
thanks
jeebee
You can do something like that
if (quoteStatus==="value"){
document.getElementById("buttonId").style.display='none';
}
else{
document.getElementById("button").style.display='block';
}
this is just javascript, you could use jquery it will make it easier for you, so your code may look like that
if (quoteStatus==="value"){
$("#buttonId").hide();
}
else{
$("#buttonId").show();
}
To get more positive reactions to your question you have to show some research effort. This question is not useful in that mather that you havent actually showed us what you have tried, and the purpose of your functionality have possibly been asked and explained before? How to hide/show div based on variable using javascript. A div and a button is both elements.
Either way, as for your question, we need to know what you already have. The task in itself have several ways to be accomplished, and based on your existing code there could be a way to complete this task in a more correct manner than others.

How to make a password that unlocks with buttons clicked in a specific order [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I've recently created a few piano keys using HTML, CSS and some Javascript and I would like to know how to go about creating a password that only unlocks when certain keys are played in a specific order.
I imagine the code would go something like:
if (correct sequence of keys are input) {
unlocks secret content;
}else{
message: try again!;
}
I've never made a password lock of any kind and I'm not sure what language would be idea for a password... Ideally it would word in browsers and on phones. I'm really new to javascript and I know that people can easily see your code so I guess I can't really use that because people would look for the password. Any ideas/guidance would be greatly appreciated!
If you don't want users to see the login credentials, you'll need to include some server side code with PHP, or ASP.NET for example so that the check is done on the server and not in the users browser.
But otherwise it would be fairly simple to do this piano key check by making each click on the buttons add a new character to a string.
var pw="";
document.getElementById('key1').onclick=function(){pw +="x"};
And then just do a standard check on that string to a saved password.

Categories