0

How can I transfer values of two different veriable on a single submit button click to an another page........using javascript & php

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by JeniF
0

A solution is to store the variable value in a hidden element inside form. For example:
document.getElementById('id').value = id_var;

Then, when the form is submitted the idea it's to create another hidden element using $_POST or $_GET. In javascript, then will be possible to use:
var id_var = document.getElementById('id').value;

0

I have posted this before, but here it is again:
I have a page that shows job posings and the recordset contains the job title called Position
on my first page I start the session, name the session and give it the value of the recordset like this:

session_start();
$_SESSION= $row_rsposition;


on the next page, I once again start the session and echo it to the screen to test it like so:

session_start();
echo $_SESSION;

you can further assign it to values on the form like this:
(this is a checkbox element)
<input name="Administrative_Support_Assistant" type="checkbox" id="Administrative_Support_Assistant" value="Y" <? if (!$_POST && (!(strcmp($_SESSION, "Administrative Support Assistant")))) { echo "checked=\"checked\"";} ?>/>

for a text box use something like this:
<input name="Position" type="text" id="Position" value=" <? echo $_SESSION;?>"


hope this helps

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.