Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. how to pass a javascript variable into asp variable?

how to pass a javascript variable into asp variable?

Scheduled Pinned Locked Moved Web Development
helpjavascriptdatabasetutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    ganeshMohan
    wrote on last edited by
    #1

    :cool:hai i am an asp programmer. i have two combo boxes optone and opttwo. i have loaded values for optone from database selected <% sqlPRO = "Select field1 From tablename" set rs= conn.Execute(sqlPRO) i=1 do while Not rs.EOF %> <%=rs("field1")%> <% i=i+1 rs.MoveNext loop rs.Close %> now i want to load a value for the second combobox opttwo it's dependant on the first combobox optone function setOptions(chosen) { var selbox = document.frm.opttwo; selbox.options.length = 0; selbox.options[selbox.options.length] = new Option('Select','oneone'); <% strSQLQry = "Select field1 From tablename where ID='" & chosen & "'" rs.Open strSQLQry, conn rs.MoveFirst While Not rs.EOF %> valFromList = "<%=rs("field1")%>"; selbox.options[selbox.options.length] = new Option(valFromList,'oneone'); <% rs.MoveNext Wend rs.Close %> } this code shows an error.i can't get the javascript variable into asp. if anyone known please help me Ganesh Mohan

    L G 2 Replies Last reply
    0
    • G ganeshMohan

      :cool:hai i am an asp programmer. i have two combo boxes optone and opttwo. i have loaded values for optone from database selected <% sqlPRO = "Select field1 From tablename" set rs= conn.Execute(sqlPRO) i=1 do while Not rs.EOF %> <%=rs("field1")%> <% i=i+1 rs.MoveNext loop rs.Close %> now i want to load a value for the second combobox opttwo it's dependant on the first combobox optone function setOptions(chosen) { var selbox = document.frm.opttwo; selbox.options.length = 0; selbox.options[selbox.options.length] = new Option('Select','oneone'); <% strSQLQry = "Select field1 From tablename where ID='" & chosen & "'" rs.Open strSQLQry, conn rs.MoveFirst While Not rs.EOF %> valFromList = "<%=rs("field1")%>"; selbox.options[selbox.options.length] = new Option(valFromList,'oneone'); <% rs.MoveNext Wend rs.Close %> } this code shows an error.i can't get the javascript variable into asp. if anyone known please help me Ganesh Mohan

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      The javascript variable is in memory in the Browser Instance. The ASP variable is in memory in the Web Server instance. Two different processes. Values in the Browser are transfered to the Server by sending a POST or GET request to the Server. Values in the Server are sent to the Browser in the Response Stream of the request.

      1 Reply Last reply
      0
      • G ganeshMohan

        :cool:hai i am an asp programmer. i have two combo boxes optone and opttwo. i have loaded values for optone from database selected <% sqlPRO = "Select field1 From tablename" set rs= conn.Execute(sqlPRO) i=1 do while Not rs.EOF %> <%=rs("field1")%> <% i=i+1 rs.MoveNext loop rs.Close %> now i want to load a value for the second combobox opttwo it's dependant on the first combobox optone function setOptions(chosen) { var selbox = document.frm.opttwo; selbox.options.length = 0; selbox.options[selbox.options.length] = new Option('Select','oneone'); <% strSQLQry = "Select field1 From tablename where ID='" & chosen & "'" rs.Open strSQLQry, conn rs.MoveFirst While Not rs.EOF %> valFromList = "<%=rs("field1")%>"; selbox.options[selbox.options.length] = new Option(valFromList,'oneone'); <% rs.MoveNext Wend rs.Close %> } this code shows an error.i can't get the javascript variable into asp. if anyone known please help me Ganesh Mohan

        G Offline
        G Offline
        Guffa
        wrote on last edited by
        #3

        Don't cross post. I answered this in the ASP.NET forum.

        --- single minded; short sighted; long gone;

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups