Command Line Question

A

amerar

Hi,

I have some javascript commands I want executed when a user clicks on
an href link. My code is below. The code works fine with the first
command, but when I add the second and third commands, nothing
happens.

However, if I remove the first command, everything works fine. But I
need all three statements. Can anyone see the error in my ways?

Thanks!

<a href=\"javascript:emailvalidation('$email','The E-mail address is
not valid');document.OptOut.action = 'activate.php?type=2&db=$db&ref=
$ref&acronym=$acronym';document.OptOut.submit();\">Click Here</a>
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Fri, 21 Sep 2007 13:45:26 GMT
(e-mail address removed) scribed:
I have some javascript commands I want executed when a user clicks on
an href link. My code is below. The code works fine with the first
command, but when I add the second and third commands, nothing
happens.

However, if I remove the first command, everything works fine. But I
need all three statements. Can anyone see the error in my ways?

Thanks!

<a href=\"javascript:emailvalidation('$email','The E-mail address is
not valid');document.OptOut.action = 'activate.php?type=2&db=$db&ref=
$ref&acronym=$acronym';document.OptOut.submit();\">Click Here</a>

Why are you using ie-specific code? Why do you have backslashes in front
of the quotes? Why href=javascript and not an onclick event? Perhaps the
email routine isn't returning properly.
 
J

J.O. Aho

Hi,

I have some javascript commands I want executed when a user clicks on
an href link. My code is below. The code works fine with the first
command, but when I add the second and third commands, nothing
happens.

However, if I remove the first command, everything works fine. But I
need all three statements. Can anyone see the error in my ways?

Thanks!

<a href=\"javascript:emailvalidation('$email','The E-mail address is
not valid');document.OptOut.action = 'activate.php?type=2&db=$db&ref=
$ref&acronym=$acronym';document.OptOut.submit();\">Click Here</a>

Try to set the javascript to be executed in onclick, see to that the
last thing is false.

set the href to point at the page itself.

As long as you don't have this in a php echo line, skip the backslashes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top