Solved

Webpage question about some code

Posted on 2013-11-05
7
263 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
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…

776 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