Solved

Webpage question about some code

Posted on 2013-11-05
7
264 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
  • 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 500 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

790 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