# Compare Javascript-gathered value with a session variable

**URL:** <https://forum.kirupa.com/t/compare-javascript-gathered-value-with-a-session-variable/241054>\
**Category:** web dev\
**Created:** [October 9, 2007, 6:33pm UTC](https://forum.kirupa.com/t/compare-javascript-gathered-value-with-a-session-variable/241054 "2007-10-09T18:33:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imagined](https://avatars.discourse-cdn.com/v4/letter/i/a87d85/32.png) [@imagined](https://forum.kirupa.com/u/imagined)\
**Post date:** [October 9, 2007, 6:33pm UTC](https://forum.kirupa.com/t/compare-javascript-gathered-value-with-a-session-variable/241054/1 "2007-10-09T18:33:21Z")

</div>

I know almost no Javascript. I got this from a script I found only and it just needs some minor tweaks…

I have a session variable I created from PHP. I need to compare it to a value entered in a form.

something like…

if(tempobj.value!= ??? SESSION VARIABLE ???)  
{  
pass=false;  
break;  
}

How can I compare this variable to the entered value?
