...

View Full Version : Problem with Sessions



wojo1086
04-01-2010, 07:33 AM
I'm trying to carry a string from one webpage to another. The user inputs some data on page 1, the info gets tested for certain elements, then gets sent to page 2. The problem is the strings aren't transferring and I don't know how to use sessions to transfer them. I need recipeNameEl, ingredientsEl, and descriptionsEl to be stored to a string and then transferred to the page the action="" attribute says. How can I accomplish this?


<script>
function checkFields() {
var recipeNameEl = document.getElementById( 'recipeName' );
var ingredientsEl = document.getElementById( 'ingredients' );
var descriptionEl = document.getElementById( 'description' );

var helperMsg1 = 'You have not filled in all required fields.';
var helperMsg2 = 'I thought I said no measurements! (No Numbers)';

return notEmpty( recipeNameEl, ingredientsEl, descriptionEl, helperMsg1, helperMsg2 );
}
</script>

<script type="text/javascript">
function notEmpty( recipeNameEl, ingredientsEl, descriptionEl, helperMsg1, helperMsg2 ){
if(recipeNameEl.value.length == 0){
alert(helperMsg1);
recipeNameEl.focus();
return false;}

if(ingredientsEl.value.length == 0){
alert(helperMsg1);
ingredientsEl.focus();
return false;}

if(descriptionEl.value.length == 0){
alert(helperMsg1);
descriptionEl.focus();
return false;}


var alphaExp = /^[a-zA-Z]+$/;
if(ingredientsEl.value.match(alphaExp)){
return true;
}else{
alert(helperMsg2);
ingredientsEl.focus();
return false;}

return true;
}

</script>

Len Whistler
04-01-2010, 08:26 AM
Looks like a Javascript session question, not PHP sessions.



------------



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum