?
Solved

Webpage question about some code

Posted on 2013-11-05
7
Medium Priority
?
268 Views
Last Modified: 2013-12-02
I have some code on a web page that checks a zip code when the user checks out of the shopping cart and puts in a pop up message telling the user that we don't ship to that zip code..

I have built a webpage to handle questions about the shipping issue and I want to put a link in the pop up message that tells the user to go to a different webpage for more information..

here is the code
        //handle error where product field 5 does not match either
    }
}
 

if(add_error == true){
    alert(add_error_message);
    forceRecalc();

} else{
    if(first_added=="Wine"){
        if(!wine_state_regex.test(ss_jQuery("input[name='zip_code']").val())){
            alert("Unfortunately we are unable to ship wine to your state at this time.  Please select a different shipping address.");
        }
    }
}

}

</script>


How would I change that pop up box to say "Unfortunately we are unable to ship wine to your state.  Please click HERE to our site that handles out of state wine shipments or please select a different shipping address"

the click here would be a webpage.  like http://www.domain.com/page.html

thanks!!
0
Comment
Question by:lefty431
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
7 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39624629
You cannot put a link inside of an alert.  You will need to have some kind of hidden container with the message and link. then for the error handling you change the display properties of the container.

There are several ways to implement it, but I think it will be easier if you post a link to the site.

Cd&
0
 
LVL 1

Author Comment

by:lefty431
ID: 39624731
the site is
www.piwine.com

if you search for a wine.  and then check out.  but put a zip code in from anywhere but Pa you will see the notice.  

I want people to get pointed to a page that allows you to check out through a third party.  that stuff isn't important, I just want the user to be directed to the page after they see the message.
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 2000 total points
ID: 39625008
Okay just after the body add:

<div id="Emsg" 
style=position:absolute;left:300px;top:300px;height:250px;width:300px;
color:black;background-color:white;z-index:20;display:none;">

Unfortunately we are unable to ship wine to your state.  Please 
<a href="http://www.domain.com/page.html">click HERE</a>  to our site that handles out of state wine shipments or please select a different shipping address.

<button onclick="document.getElementById('Emsg').style.display='none';" 
value="close">close</button></div>

Open in new window


then change the test condition code to:
if(!wine_state_regex.test(ss_jQuery("input[name='zip_code']").val())){
document.getElementById('Emsg').style.display='block';

Open in new window



Cd&
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 39625182
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39625978
I edited the topic list to remove JAVA, as the question has absolutely nothing to do with JAVA.

COBOLdinosaur, Topic Advisor
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question