Click here to Skip to main content
15,920,603 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
var values = "";
						$("input[name=DynamicTextBox]").each(function () 
						{
							values += $(this).val() + ",";
							
						});
						<?php 
						//$pst_strength_weakness1="values"; 
						//$pst_strength_weakness1 = "<script>document.writeln(values);</script>";
						?>
						//alert(values);
						//document.cookie = "values = " + values;
						
						<?php
							
							//$pst_strength_weakness1= $_COOKIE['values'];

?>

What I have tried:

every values remains in cookie. After reload values are showing.
Posted
Updated 1-Mar-21 8:54am

1 solution

Remeber: php does not exist on the client side and javascript doesn't exist on the server side.

You have two main options:
1 - if it's a form you can use that to send values to a php file (for rendering) on the server and it will come back to the client with the value having been made available.
2 - AJAX - the better way - it lets you use javaScript to send things to the server without affecting the current page (unless you want to).

Now - once on the server side you need to do what you wish with it and, if it's part of what you need to do, create the new information on the client as HTML, javaScript, etc.

AJAX Introduction[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900