Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.write

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I don't know a lot about Active X, but I do know Visual Basic, and sort of VBScript. I am trying to get a form to return a page based on the form results. I am trying to get a combo box to make the document print a section of HTML. I can get things like this to work with If Then's but whenever there are objects like submit buttons or textboxes document.write does not work. Is there another thing like document.write or document.writeln or document.open that would do what I want?
 
I'm not sure if i completely understand your question, but here's a try. There are two ways that you can do this (really one way, and a variation). First, you could submit your form to an ASP page (or some other type of server interpreted page) which would request the result from the form object in question. Based on the input provided by that form, the ASP page would choose what to display, using response.write commands which would spit back HTML. Example:

...Form.Htm
<Form name=&quot;frmTest&quot; action=&quot;Result.asp&quot; method=&quot;post&quot;>
<input type=&quot;text&quot; name=&quot;txtInput&quot; size=&quot;30&quot;>
<input type=&quot;submit&quot; name=&quot;btnSubmit&quot; value=&quot;OK&quot;>
</Form>


...Result.asp
<%
txtInput = Request(&quot;txtInput&quot;)

'------------------------------------------
'Do whatever branching you need to do here
'Set the result to txtResults (for example)
'------------------------------------------

'Now write your response based on the requested data,
'formatted withing the proper HTML tags.
Response.Write &quot;<H1>&quot; & txtResults & &quot;</H1>&quot;
%>

The other way is just a slight variation of the above, and you would use a dynamically created query string based on the selection the user chooses on the form. Both ways would need to be interpreted by another ASP page, or COM object.

Lastly, you can use DHTML to achieve an effect which would display results to a user in realtime. For example, you may have three buttons, and depending on the button the user pressed, the text below the buttons (as an example) would change dynamically. What's really happening though, is the entire page, and *all* the HTML would be loaded when the page is initially requested. The DHTML coding behind the buttons however would make the displayed text dynamically visible or invisible depending on the buttons pressed.

Does this help? If I've missed your question completely, please tell me...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top