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 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Sending a javascipt return value on Post

    Hi, its been ages since ive done any javascripting/asp and im a bit stuck as how to do this,

    Basically im trying to detect wether the operating system is a windowsCE OS or not and post the value to the next page where i can put it in a session variable.

    the script im using is

    <script>
    <!--
    function checkOS() {
    if(navigator.userAgent.indexOf('CE') != -1)
    { var OpSys = "CE"; }
    else { var OpSys = "WIN"; }
    return OpSys;
    }
    -->
    </script>



    and i need some way of posting the returned value on the submit of the form to the next page, along with other values that are in the form.

    This is probably real easy...

    Any help would be greatly appreciated here.

    Thanks

    Steve.

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    Create a hidden field, give it a name and an id. Then it's simply document.getElementById('fieldID').value=checkOS(); and access it by name on the server. Also, are Win and WinCE the only OSes you want to deal with?
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    45
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah Im only bothered if its a CE os really, where do i put the document bit though, this whole things bothering me a bit, ive not done any web development for about 3 years now...


  •  

    Posting Permissions

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