Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jan 2004
    Location
    San Antonio, TX
    Posts
    131
    Thanks
    1
    Thanked 0 Times in 0 Posts

    2parts-text area, and js alerts, how do you...

    PART I. How do you specify the background color of a text area? and also would like to know if there is a way to write protect the info in the text area, so a user does not change what is written in the text area, then print out so something completely different comes out. <would be for a legal agreement form>. Can someone help me with this???

    PART II. I am interested in a script that would allow me to specify what options come out on a javascript alert box. I want to have options like 'yes' and 'no' instead of 'OK' and 'Cancel'., and then have those options take the user to different pages within the site, depending on which option they click. Is this possible?

    I am very new to javascripts, so please answer in lamens terms. below is the code I am working with. Any help would be greatly appreciated...Thanks in Advance...ImperialSpider

    <html>
    <head>
    <title>agreement form</title>
    <script type="text/javascript">
    function agreesubmit(el){
    var tempobj;
    var els=el.form.elements;
    for (var i=0;i<els.length;i++){ //hunt down submit button
    tempobj=els[i];
    if(tempobj.type.toLowerCase()=="submit")
    tempobj.disabled=!el.checked;
    }
    }
    function defaultagree(el){
    if (el.agreecheck.checked){
    alert("Great, Lets get started.");
    location.href='page1.html';
    }
    else
    alert("Please check the box if your agree to the conditions")
    return false
    }
    </script>
    </head>
    <body>
    <form name="agreeform" onSubmit="return defaultagree(this)">
    <p>YOU MUST MEET MY CONDITIONS, WHICH ARE...</p>
    <textarea rows="5" name="S1" cols="30" style="width:60%" wrap="virtual">
    1. FIRST CONDITION.
    2. SECOND CONDITION.
    3. THIRD CONDITION.
    4. FOURTH CONDITION.
    5. FIFTH CONDITION.
    6. SIXTH CONDITION.
    7. SEVENTH CONDITION.
    </textarea>
    <p>
    <input name="agreecheck" type="checkbox" onClick="agreesubmit(this)" />
    <b>Check box if you agree to the above conditions</b>
    <p><input type="Submit" value="Submit!" disabled="disabled" /></p>
    </form>
    </body>
    </html>

  • #2
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    <textarea rows="5" name="S1" cols="30" style="width:60%; background-color: red;" wrap="virtual" readonly="readonly">

    You cannot change which buttons appear in a javascript alert(as far as I know anyhow )

  • #3
    Regular Coder
    Join Date
    Jan 2004
    Location
    San Antonio, TX
    Posts
    131
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Smile Thanks Brando,

    That worked and was exactly what I was looking for. However, with the alert script does exist...I have seen it on some helpsite like javascriptkit.com somewhere, but dont remember where, and now I can't find it. I also tried dynamicdrive.com and could not find it there either. I am not sure what the script would be called to look it up either, and dont remember which one it was, or if it was at another site altogether. I hope someone in here knows it. But thanks for your help.

    Imperial Spider

  • #4
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    I did a search for alert box...http://www.sitelevel.com/query.go?cr...&I1.x=0&I1.y=0
    I've heard it's been done in vbscript, for IE only, but never with javascript...

  • #5
    Regular Coder
    Join Date
    Jan 2004
    Location
    San Antonio, TX
    Posts
    131
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Thumbs up You've done it again

    Yes, it seems you are the correct one here... but I did see it, only I was looking at the vbscript, and not javascript...at any rate, I found what I was looking for in that link, and I have you to thank for that. Many Kudos go to you for your help. Thanks again,

    Imperial Spider

  • #6
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    You're welcome


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •