Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer backup black screen blue screen boot bsod computer connection crash css dell drive driver drivers email error ethernet excel explorer firefox firefox 3 hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Help please - javascript


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
Shelbyville's Avatar
Junior Member with 17 posts.
 
Join Date: Oct 2007
Experience: Beginner
04-Oct-2007, 06:19 AM #1
Solved: Help please - javascript
Hi

Had help with this previously... The code below allows me to enter a UK postcode and check if deliveries are made to this are, displaying messages depending on the postcode. However once i've run it once, i cannot run it again as when i click in the text box it displays the "else" message. Can i add a line to the function to refresh??

I have tried but can't seem to get it working? Don't think this is my strong point! LOL!

HTML Code:
<table><tr><td><div style="position:relative; left:20px"><br /> 
Postcode:&nbsp;&nbsp; <input name="postcode" type="text" maxlength="12" id="postcodeid" class="Workflow" style="width:90px;" onclick="checkarea(this.value);" /><input type="text" style="VISIBILITY: hidden; POSITION: absolute" /> <input type="button" name="b1" value="Enter" /> <script type="text/javascript"> <!--
function checkarea(value)
{
if (value.match(/g/))
alert ("We do deliver to you area");
else
alert("Unfortunately we are unable to deliver to you area at the moment");
}
//--> </script> </div></td></tr></table>
As always help is greatly appreciated!
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,705 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
04-Oct-2007, 02:45 PM #2
What if the checkarea() function was called for an "onchange" event instead of "onclick"?

Peace...
MMJ's Avatar
MMJ MMJ is offline
Distinguished Member with 3,248 posts.
 
Join Date: Oct 2006
04-Oct-2007, 04:17 PM #3
Oops, tomdkat is right, I was supposed to but onchange instead of onclick.

My bad.
haswalt's Avatar
Computer Specs
Senior Member with 416 posts.
 
Join Date: Nov 2004
Location: South Coast, UK
Experience: Advanced
05-Oct-2007, 04:41 AM #4
Is this solved?

please click the solved button at the top
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:48 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.