473,471 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Passing input box variable to jscript

3 New Member
Hello. Hoping someone can help me out with this. Please forgive me as I'm very new to jscript.

I need to have the input box at the top of the page store the string to a variable. I then need that variable to be used in line 7. Since I'm not able to get the variable to work in line 7, i currently have 'testaccount' hard coded.

Hoping someone can help. Thanks in advance.

-Steve

Expand|Select|Wrap|Line Numbers
  1.  <%@ language = JScript %>
  2. <% 
  3.     Response.Write("<H3>"+ Request("name") +" was entered...</H3> ");
  4. %>
  5.  
  6. <%
  7. var user=GetObject("WinNT://domain.com/testaccount");
  8.  
  9. if (user != null) {
  10. %>
  11.   <form action = "final.asp" method = "post" runat = "
  12.   ">
  13.       Name: <Input type=Text name = "name"/> 
  14.       <br/>       
  15.     <Input type=Submit value="Submit"/>
  16.    </form>
  17.  
  18.  
  19. <table>
  20. <tr><td>Class:</td><td><%=user.Class%></td></tr>
  21. <tr><td>Name:</td><td><%=user.Name%></td></tr>
  22. <tr><td>Full Name:</td><td><%=user.FullName%></td></tr>
  23. <tr><td>Description:</td><td><%=user.Description%></td></tr>
  24. <tr><td>Last Login:</td><td><%=user.LastLogin%></td></tr>
  25. <tr><td>Password Expiration date:</td><td><%=user.PasswordExpirationDate%></td></tr>
  26. <tr><td>Account Disabled:</td><td><%=user.AccountDisabled%></td></tr>
  27. <tr><td valign="top">Groups:</td><td>
  28. <%
  29.     for (var e = new Enumerator(user.Groups()); ! e.atEnd(); e.moveNext())
  30.     {
  31.         var oGroup = e.item();
  32.         Response.write(oGroup.Name+"<br>\n");
  33.     }
  34. %></td></tr>
  35. </table>
  36. <%
  37. } else {
  38.     Response.write("User is null");
  39. }
  40. %>
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48. </body>
  49. </html>
Nov 13 '07 #1
5 1904
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!

This looks like ASP. Do you want this on the client-side or when the page is submitted?
Nov 14 '07 #2
steve9013
3 New Member
Thanks for the welcome!

I understand your question, but I'm really not sure if I need this to run on the client or server side. Currently, with the variable hard coded (not from the input textbox), the script runs as i'd like it to. It returns the correct data. Any suggestions?

And yes, this is ASP. Sorry for not mentioning that.

Thanks
-Steve




Welcome to TSDN!

This looks like ASP. Do you want this on the client-side or when the page is submitted?
Nov 14 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
I understand your question, but I'm really not sure if I need this to run on the client or server side. Currently, with the variable hard coded (not from the input textbox), the script runs as i'd like it to. It returns the correct data. Any suggestions?
You'll want it on the client-side if you don't need to submit the form to get the text box value. If this is after the submit, which I think it probably is, then you'll need the posted form variable using server-side code.
Nov 14 '07 #4
steve9013
3 New Member
Thanks! How would I do this with the server side code?


You'll want it on the client-side if you don't need to submit the form to get the text box value. If this is after the submit, which I think it probably is, then you'll need the posted form variable using server-side code.
Nov 14 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
It shouldn't be too difficult, but I'll pass this over to the ASP experts since it's an ASP-related query.
Nov 14 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
0
by: cschang | last post by:
Sorry, I am only a month new to .net world. I have no ideal where this subject should be posted. so i post her and the .general group. Hope you do not mind. I used the example from MS of file...
25
by: Victor Bazarov | last post by:
In the project I'm maintaining I've seen two distinct techniques used for returning an object from a function. One is AType function(AType const& arg) { AType retval(arg); // or default...
6
by: veganeater | last post by:
Hi Everyone, I was wondering if there was a way to pass a variable to a popup window. The purpose is make it so when a user clicks on a specific region/link of the glossary page, a popup opens...
6
by: ged | last post by:
Hi, i am a oo (c#) programmer, and have not used javascript for a while and i cant work out how javascript manages its references. Object References work for simple stuff, but once i have an...
5
by: Ido.Yehieli | last post by:
Hi all, I'm new to c# and .net and I have a few questions I did not manage to find an answer to: 1. what is the equivalent to the "exec" command in python/lisp? meaning: a string is given as...
4
by: jej1216 | last post by:
I'm pretty new to PHP and MySQL. I have managed to create a form that inserts data to MySQL and to create a form to search the DB. Now here is my problem. I am unsuccessful coding a hidden...
1
globalguideline
by: globalguideline | last post by:
Hi all here at forum. I am working to find out some solution to access a web page in PHP that is showing information on the bases of given argument in query string variable. My problem is this that...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.