Client-side to Server-Side

Results 1 to 3 of 3

Thread: Client-side to Server-Side

  1. #1
    Join Date
    Dec 1969
    Posts
    1,315

    Default Client-side to Server-Side

    Is it possible to include server-side scripting within a client-side script function? If yes, how do pass variables to/from the client-side script to the server-side & vice-versa? eg:<BR><BR>&#060;SCRIPT LANGUAGE="JAVASCRIPT"&#062;<BR>function somefunction() {<BR> fieldvalue=somevalue ;<BR><BR> &#060;%<BR> command="select * from table where field=?"<BR> command("param1") = fieldvalue &#039from client-side script above <BR> set rs = command.execute<BR> %&#062;<BR>}

  2. #2
    e Guest

    Default RE: Client-side to Server-Side

    This paticlular example wuld not work correctly for one<BR>reason - the ASP code is executed before the client code.<BR>You can use ASP to write Client side script like so:<BR><BR>&#060;% variable = request.Form("Fieldname")%&#062;<BR><BR>&#060;SCRI PT LANGUAGE="JAVASCRIPT"&#062;<BR>Function () {<BR>filevalue = &#060;%=variable%&#062;;<BR>}<BR><BR>There is something called remote scripting built that works with<BR>IE that might be what you&#039re looking for. This only works with IE<BR>though. More info can be found at: <BR>http://msdn.microsoft.com/scripting<BR><BR>I hope this helps :)

  3. #3
    Join Date
    Dec 1969
    Posts
    13

    Default RE: Client-side to Server-Side solution doesn

    I tried this - the parser tells me that the variable is undefined after the two alert boxed run<BR><BR>code is thus:(all above the &#060;form&#062; tags<BR><BR>&#060;%variable = "variable"%&#062;<BR>&#060;SCRIPT LANGUAGE=javascript1.2&#062;<BR>&#060;!--<BR><BR>function looker()<BR>{var hiho = "hello";<BR>alert(eval(document.one.length));<BR>a lert(eval(document.one.elements[0]));<BR>document.one.elements[0].value=&#060;%=variable%&#062;;<BR>document.one.el ements[2].value=document.one.elements[0].value;<BR>alert(document.one.elements[2].value)<BR>}<BR> <BR>//--&#062;<BR>&#060;/SCRIPT&#062;<BR>

Posting Permissions

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