I've constructed a survey form, and I want to make the radio buttons sticky, so that if participants leave the page, they can return to find their answers still in tact. However, I can't seem to find the right code to make the radio buttons sticky. Below is the code I'm using. Any help would be appreciated. - <p>Do you enjoy web designing?<br />
-
<input name="ans1" type="radio" value="yes"
-
<?php if ($_GET["ans1"]=="yes") echo "checked=\"checked\""; ?>/>
-
yes
-
-
<input name="ans1" type="radio" value="no"
-
<?php if ($_GET["ans1"]=="no") echo "checked=\"checked\""; ?>/>
-
no
-
-
<input name="ans1" type="radio" value="unsure"
-
<?php if ($_GET["ans1"]=="unsure") echo "checked=\"checked\""; ?>/>unsure</p>
-
-
7 3096
Is the form passed by GET? Sounds obvious, but the code works for me as long as I pass the values through the GET method.
Forgive my ignorance. I'm not sure what you mean. I've tried the form with both POST and GET.
@wktarin
Can you post the full form, please?
Thanks,
Markus.
Oh wait, sorry, I read the question wrong. You want people to be able to navigate away from the page, then return and still have the form values?
You'd have to use sessions to hold the form values.
Check out this article.
Thanks,
Markus.
Atli 5,058
Expert 4TB
On thing that could be a problem.
Do you want people to be able to navigate away *while* answering the form, without submitting it, and then return to find the answers as they left them?
If that is the case, you would have to look into JavaScript solutions.
PHP can only work with the data it is given, and you would actually have to submit the form to get the data to your PHP code.
Thank you for your responses. Could you give me a hint about what JavaScript I would need to use, or where I could find information on constructing it? I'm really not familiar with Java (and I'm pretty green at PHP, for that matter.) Thanks for helping.
I decided to simply have the links open in another window. Thank you both for your input.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jeff |
last post by:
I'm trying to create a dynamic form that can have multiple groups of
radio buttons (each group has two buttons) with the same name.
Essentially, the form allows a user to enter as many names as...
|
by: Oscar Monteiro |
last post by:
I Have to sets of Radio buttons like so:
<input type="radio" name=p1 value=1>
<input type="radio" name=p1 value=2>
<input type="radio" name=p1 value=3>
<br>
<input type="radio" name=p2 value=1>...
|
by: Craig Keightley |
last post by:
I have a page that has n number of radio groups (yes/No)
how can i prevent the form being submitted if more than one radio group is
not selected?
By default all radio groups are unchecked
...
|
by: James P. |
last post by:
Help,
I need to display radio buttons on a form. The data is from SQL
table: each row in each table is displayed as a radio button. I have
multiple SQL tables so I understand I need to put...
|
by: kenny8787 |
last post by:
Hi, can anyone help here?
I have the following code generated from a database, I want to have javascript calculate the
costs of the selected items using radio buttons, subtotal the costs and...
|
by: FlaPnthrsPunk |
last post by:
Hi all, this is my first time ever using PHP, and I am still very new to programming in general. I'm doing an assignment for my Media E-Commerce class where the code for a survey is all provided. ...
|
by: dpazza |
last post by:
Hi,
I'm creating a quiz on using a form in VB 2005 express.
I have four sets of questions and answers (labels and radio buttons)
and I change between which set of questions is currently shown on...
|
by: Blasting Cap |
last post by:
I have a page that has a number of radio buttons that will be displayed
to different access levels of a user who logs in to my website.
For instance, if there are a dozen buttons, user1 will see...
|
by: roger26 |
last post by:
I am having trouble with a registration page. Which contains 3 groups of radio buttons and a check box i having hard time to making it work. I have added code for matching the password too but having...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |