homepage Welcome to WebmasterWorld Guest from 54.166.148.189
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Formmail redirect now not working
I'm sure it was befor, but not now
Kenton




msg:1485581
 11:02 pm on Nov 21, 2005 (gmt 0)

Hi

I have a piece of code that redirects users to a payment screen if their purchase is!= $0

It used to work, and I don't "think" I've modified it.

can someone have a look and see what's up.


if ( totamt!= "0.00" )
{ formchecked = true;
clientdetails = "Name:"+ thisform.businessname.value + "Phone:" + thisform.dayphone.value;
clientdetails = clientdetails.replace(/ /i,"_");
var URLQry = "http://www.example.com.au/response2.htm"+"?value=";
URLQry = URLQry + totamt + "name=" + clientdetails;
thisform.redirect.value=URLQry;
} else
{ thisform.redirect.value="http://www.example.com/response.htm";
};

basically it goes to the right place if the totamt = 0 but goes to some sort of default formmail "Thankyou" page if there is a value.

Any Ideas?

 

rocknbil




msg:1485582
 11:12 pm on Nov 21, 2005 (gmt 0)

that redirects users to a payment screen if their purchase is!= $0

if ( totamt!= "0.00" )

$0, "0.00", and 0 are all three different values. :-) Logically they are not, but by quoting "0.00" it's possible it's seeing it as a string.

try testing it as a number
if (totamt > 0)

This should work for 0.00, 1, 1.55, or any actual number.

Unless you have the $ in totamt, which would complicate things.

Kenton




msg:1485583
 10:11 am on Nov 22, 2005 (gmt 0)

Hi,
That doesn't seem to be it.

It correctly goes to the else part on 0 but when it processes the "if" part it redirects to the default "Thank you" page.

Kenton

Kenton




msg:1485584
 10:35 pm on Nov 24, 2005 (gmt 0)

Hi

So acn anyone see what's wrong with this piece of code?
formchecked = true;
clientdetails = "Name:"+ thisform.businessname.value + "Phone:" + thisform.dayphone.value;
clientdetails = clientdetails.replace(/ /i,"_");
var URLQry = "http://www.example.com.au/response2.htm"+"?value=";
URLQry = URLQry + totamt + "name=" + clientdetails;
thisform.redirect.value=URLQry;

Thanks
Kenton

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved