Hey,
Simple javascript problem:
user enters desired domain name into "domain" field and submits, php scripts check if domain is available. If it is, a paypal add to basket button is written onto the page, however i cannot use php to get the content of the "domain" field and put it into hidden fields of the paypal button for various reasons so instead I need to use javascript. Also i want to search what the user entered to find out what kind of domain suffix they typed (.co.uk, .com etc) and write a variable with a corresponding price. I have VERY little experience with javascript and am only really able to code what is below from knowledge of php and tutorials but the script isnt working. any ideas?
var domain = document.getElementById("domain").value;
var domainsuffix1 = (domain.search(/.com/i));
if (var domainsuffix1 > 0) {var domainsuffix = "£5";};
Thanks,
Max