Jump to content

manick

Members
  • Posts

    21
  • Joined

  • Last visited

manick's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thanks I'll look into itNick
  2. Can anybody please tell me where I am going wrong, I am trying to set a cookie on a flash intro page to basically say if I have been here before, go straight to the main.html page.As ever, any help much appreciated!!function chkcook(){ if (document.cookie.beenbefore !='TRUE'){ }else { window.location="main.html"; return false } //stop hiding--> </script> <script > <!--hide function previousCookie (name, value) { // number of days the cookie should last var expDays = 180; var exp = new Date(); exp.setTime(exp.getTime() + (expDays * 24 * 60 * 60 * 1000)); expirationDate = exp.toGMTString(); // Set cookie with name and value provided // in function call and date from above document.cookie = name + '=' + escape(value) document.cookie += '; expires=' + exp.toGMTString();}I AM THEN TRYING TO CALL THEM WITH THE FOLLOWING:<<body onload="SetCookie('wishlist',cookieString)";"chkcook()";"onblur="previouscookie('beenbefore','TRUE')";>Many thanksNick Trenam
  3. many thanks for that raimo and blue, am now trying it out to see where i am going wrong!!!All your help is very much appreciated.RegardsNick Trenam
  4. Hey all,Thanks for that, am i to assume that this must have a full url to work i.e. www.whatever.com/whatever, the reason i ask is because unfortunately all i have ot work with is a personal area on the Open University site that starts http://ouserver/myname/page.html. The reason I ask is because i have tried both of the ways you 2 have ssuggested but it still does the same thing.Raimo with regard to your code what do the following lines of code do:var x = document.referrer.split('/');x = x[x.length - 1];x = x.split('?')many thanks again for your help.Regards nick
  5. Hi all,Sorry about this, we did have a thread going on this, and thought it was sorted, however I now have managed to test the following script on a live server and it just keeps opening up the index.html page, regardless of where it opens the pages from. Any help much appreciated as to where I am going wrong:function checker(){var x=document.referrerif ((x=="main.html")||(x=="wishlist.html")||(x=="prodblank.html")||(x=="form.html")||(x=="product1.htm")||(x=="index.html")){ return true} else {window.location="index.html";return false} }many thanksNick Trenam
  6. ahhh!! that makes sense now, thanks scottNick
  7. Hi all,I have the following basic script for document referrer, and regardless of where the page has been loaded from it refers me back to the index page, can someone please tell me what i m missing!!function checker(){var x=document.referrer;if ((x=="main.html")||(x=="wishlist.html")||(x=="prodblank.html")||(x=="form.html")||(x=="product1.htm")) { return true} window.location="index.html";return false} Many thanks in advanceNick Trenam
  8. Hi there,thanks for that, but unfortunately, the remit says that I have to validate as the user enters data rather than on submit (I have already had to show that I can perform on submit) , therefore that is the problem i am having with the onblur event. Is there a better way handler than onblur that will not return an error, but will force the user to enter data (i.e. onchange won;t do what I need it to do.TaNick
  9. Hi all,I have to validate three form fields on the fly, i thought about using onblur but it blobs it!!! how do you go about validating fields on more than one field without it going into an endless loop, here is the code i am using so you can see the problem i am encountering:<script>var regexp=/^[A-Z]{1,2}\d{1,2}\s{0,}\d[A-Z]{2}$/ifunction chkPC(shipPostCode){if (!regexp.test(shipPostCode.value)) {shipPostCode.value="Please enter PostCode";shipPostCode.focus();return false}return true}</script><script>function chkAddy(shipDelivery) {if ((shipDelivery.value=="Enter the delivery address.")||(shipDelivery.value=="")||(shipDelivery.value=="Please enter your correct Shipping Address")) {shipDelivery.value="Please enter your correct Shipping Address";shipDelivery.focus();return false}else{return true;}}</script><script>var cardexp=/^\d{4}\s{0,}\d{4}\s{0,}\d{4}\s{0,}\d{4}$/function chkCard(billCardNumber){if (!cardexp.test(billCardNumber.value)) {billCardNumber.value="Please enter your credit card number";billCardNumber.focus();return false}return true}</script>Im using onblur, but obviously as the user tries to go onto the next field (which also has onblur) if they have filled it out incorrectly, the browser locks.Any help much appreciated!!Manick
  10. Hi Scott,I managed to get my original code working by taking out a link to an external script. The problem I can't get my head around is using a mix of external scripts and functions in the header, If I have a link to an external script in the script tag in the head, the functions in the head when called return an "object expected" error. Thanks mateyNick
  11. yeah sorry, but as I say I've got to do it unfortunately, I'm beggared then cos I can't get it working??!??!??!?many thanksnick
  12. Hi again Scott,Unfortunately it's part of the project i am doing that it has to throw an alert up! CheersNick
  13. Hi all,I have the following in the head: function chkName(billFamilyName){ if (billFamilyName.value=="") { alert("Please write your name") billFamilyName.focus() }}and this in the body: <td><input type="text" onblur="chkName(this)" name="billFamilyName" maxlength="30"></td>but it is returning an object expected on the onblur, can someone give me an idea as to what I have done wrong, I am assuming it's something to do with whats in the () but am not sure. Any help appreciated.Tanick
  14. K, Thanks again Scott
  15. Hi Choobakka, You're not doing the OU TT281 course by any chance are you??????Nick T
×
×
  • Create New...