Checkbox value to second form.

I have a mulipage form that I am trying to pass form input from one page to the next.  On page 1 I have the following checkbox:

<input name="ADD_AC" type="checkbox" id="ADD_AC" onClick="CalculateTotal(this.form)" value="Yes" checked>

On page two, I am trying to have the form input display the Yes value like this:
Add AC? <?php echo((isset($_POST["ADD_AC"]))?$_POST["ADD_AC"]:"") ?>

The Yes value needs to show up there, can this be done?

Thanks in advance!
Who is Participating?
missing semicolon - gets ya every time

Add AC? <?php echo((isset($_POST["ADD_AC"]))?$_POST["ADD_AC"]:""); ?>
Yes, this can be done.

For security purposes, however, I would suggest that you check when you first retrieve information from the $_POST array, that $_POST['add_ac'] is either set to "Yes" or nothing at all.
pda4meAuthor Commented:
Okay, thanks.  Can you provide edits to the code above to do this?  I am trying the above and its not working.
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

actually, you might like this one better - easier to read without so many parenthesis:

Add AC? <?=isset($_POST["ADD_AC"])?$_POST["ADD_AC"]:"";?>
pda4meAuthor Commented:
Thanks Mason, that is what I was looking for.  Is there a particular benefit using one or the other?  Is there any security benefit as mentioned above?
I'm not sure there's any real security risk here. I didn't understand what TheAnarchist meant in his comment. As for the one versus the other, the only benefit I can see is readability, and the value of that is entirely in the eye of the programmer.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.