/    Sign up×
Community /Pin to ProfileBookmark

cookies not setting why?

hi,

cookies is not setting whats wrong with this, pls help me..

<script type=”text/javascript”>
function validate_form(frm)
{

if(frm.username.value==””)
{
alert(“Username Misssing”);
return false;
}
else
{
if(setCookie(‘username’,frm.username.value))
{
alert(“sucess”);
}

}

}
</script>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@Sterling_IsfineMay 04.2010 — You need to show more code or a preferably URL.

At the very least you must show how [I]validate_form[/I] is called and the code for the [I]setCookie[/I] function.
×

Success!

Help @phpmady spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...