Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. scriptOhead

    Function doesn't return a value

    if(DateFormat = 1) should be if(DateFormat == 1) '=' is an assignment operator so it Gives DateFormat a value of 1. '==' queries whether it is 1.
  2. scriptOhead

    filling a textarea from code

    str = "one \n\r two \n\r three."; document.Formname.fieldName.value = str; use \n\r but \r by itself may be enough.
  3. scriptOhead

    how to determine 'checked' status for 18 checkboxes?

    You can also use the form elements array. var lgn = document.formName.length; for(var i = 0; i < lgn; i++){ if(document.formName[i].type == &quot;checkbox&quot; && document.formName[i].checked == true){ alert(document.formName[i]+&quot; is checked&quot;); break; } }
  4. scriptOhead

    Need help with RegExp...

    It will not allow me to put word--word. Here is the entire page. Try it out - <HTML> <HEAD> <TITLE>Reg Exp</TITLE> <script type=&quot;text/javascript&quot;> /* No double spaces or double - (&quot; &quot; or &quot;--&quot;) */ var reg = /[^a-zA-Z\s-]|(\s\s)|(--)/g; function A(a){ var...
  5. scriptOhead

    Need help with RegExp...

    I tested it and it seems to work. Can you give me an example of what dosen't work with it? Or anyone else?
  6. scriptOhead

    Need help with RegExp...

    I believe it is possible to do it with one regExp. See my last post above.
  7. scriptOhead

    Need help with RegExp...

    The one above has a mistake but this I think works- var reg = /[^a-zA-Z\s-]|(\s\s)|(--)/g;
  8. scriptOhead

    Need help with RegExp...

    var reg = /[^a-zA-Z]+[ --]/g;
  9. scriptOhead

    Creating a pattern to check against

    ps the line above should read if(str.match(badChars)) - I changed the var name.
  10. scriptOhead

    Creating a pattern to check against

    <script type=&quot;text/javascript&quot;> var badChars = /[^a-zA-Z -]/g; function A(a){ var str = a; if(str.match(reg)){ alert(&quot;bad char&quot;); } if(str.indexOf(&quot; &quot;) != str.lastIndexOf(&quot; &quot;)){ alert(&quot;too many spaces&quot;); } if(str.indexOf(&quot;-&quot;) !=...
  11. scriptOhead

    Capturing Keycode For Lowercase Character

    You need to post your code.
  12. scriptOhead

    Strip Whitespace

    ps. My post above will strip linebreaks as well, if that's what you need.
  13. scriptOhead

    Strip Whitespace

    <html> <head> <title>Strip White Space</title> <script type = &quot;text/javascript&quot;> var str = &quot;&quot;; var whiteChars = /[ \n\r]/g; function A(txt){ str = txt.replace(whiteChars, &quot;&quot;); document.F.a.value = str; } </script> </head> <body bgcolor=&quot;#ffffff&quot;>...
  14. scriptOhead

    checkbox validation - require one or two values

    var check = new Array(false, false, false); function keepCheck(n){ check[n] = !check[n]; } function btnOne(){ if(check[0] || check[1] || check[2]){ //code; } } function btnTwo(){ if(check[0] || check[1] || check[2]){ //code; } } function btnThree(){ if((check[0] && check[1]) || (check[0]...
  15. scriptOhead

    click hyperlink - passes value back to parent window

    You can also use the id attribute- <a href =&quot;#&quot; id = &quot;test Id&quot; onclick=&quot;A(this.id)&quot;>###</a>
  16. scriptOhead

    Communicating with popup windows.

    in the popup put- <body onload = &quot;opener.sendText()&quot;> In the page that opens the popup- function sendText(){ var statusTxt = &quot;blah&quot;; w.document.open() etc.
  17. scriptOhead

    Communicating with popup windows.

    var w = window.open(etc... w.document.forms[0].inputName.value = will target the popup.
  18. scriptOhead

    help :( javascript error-..

    Try- <a href=&quot;#&quot; onclick=&quot;openLargeImage('Kiss','departs/kiss/large/001.jpg',221,300);return false;&quot;>
  19. scriptOhead

    Next letter

    function a(){ var letter = &quot;1a&quot;; var n = letter.substr(1,1); n = n.charCodeAt(0);alert(n); n++; n = String.fromCharCode(n);alert(n); letter = letter.substr(0,1)+n; alert(letter); }
  20. scriptOhead

    Please help me validate this textbox...

    You're welcome.

Part and Inventory Search

Back
Top