can't figure out this simple task - DOTNET
This is a discussion on can't figure out this simple task - DOTNET ; I'm using VS to create a form. I want a user to be able to input in to a
field either the html code (<a href="http:\\www.mysite.com" Click here!</a>)
or use some built in function where when the form is submitted ...
-
can't figure out this simple task
I'm using VS to create a form. I want a user to be able to input in to a
field either the html code (<a href="http:\\www.mysite.com" Click here!</a>)
or use some built in function where when the form is submitted and displayed
back to me it displays the label as a hyperlink rather than the full web
address.
Any help would be greatly appreciated.
-
RE: can't figure out this simple task
Is this a web app or windows app? Is it public or private?
Reason I ask is that what you need to do is have the server-side code render
the HTML that the user entered into a text box on postback. That could be
exceedingly dangerous if the client enters various forms of script.
Anyhow. With a web app, you can capture the posted client text in a variable
and use Response.Write to write it back to the document stream on postback.
That's the simplist way. There are others, including client-side JavaScript.
"JBeckett [MCSA]" wrote:
> I'm using VS to create a form. I want a user to be able to input in to a
> field either the html code (<a href="http:\\www.mysite.com" Click here!</a>)
> or use some built in function where when the form is submitted and displayed
> back to me it displays the label as a hyperlink rather than the full web
> address.
>
> Any help would be greatly appreciated.
-
Re: can't figure out this simple task
<html>
<head>
<script language="javascript" type="text/javascript">
<!--
function myButton_onclick()
{
document.getElementById("myDiv").innerHTML =
document.getElementById("myTextBox").value;
}
// -->
</script>
</head>
<body>
<div id="myDiv"></div>
<input id="myTextBox" type="text" />
<input id="myButton" type="button" value="Click Me!"
language="javascript" onclick="return myButton_onclick()" />
</body>
</html>
________________________
sa@openwinforms.com
http://www.openwinforms.com/
OpenWinForms - open source windows forms and controls
Google group - http://groups.google.com/group/open-winforms
-
Re: can't figure out this simple task
This, to me, appears to be client side wiring of an event for a web page
using javascript.
1. Type something in a text box
2. Click the button
3. The text in the text box is then written in the Div tag.
The moving pieces are:
1. onclick="return myButton_OnClick();" This bit tell the web page what to
do when the button is clicked. Kinda like a delegate pointer in .Net
2. myButton_OnClick() this function is the routine that places the text
from the textbox in the Div Tag
3. getElementById says find an html tag that has it's ID attribute set to a
certain value
<sa@openwinforms.com> wrote in message
news:uA3t2jn3HHA.4880@TK2MSFTNGP03.phx.gbl...
> <html>
> <head>
> <script language="javascript" type="text/javascript">
> <!--
>
> function myButton_onclick()
> {
> document.getElementById("myDiv").innerHTML =
> document.getElementById("myTextBox").value;
> }
>
> // -->
> </script>
> </head>
> <body>
> <div id="myDiv"></div>
> <input id="myTextBox" type="text" />
> <input id="myButton" type="button" value="Click Me!"
> language="javascript" onclick="return myButton_onclick()" />
> </body>
> </html>
>
> ________________________
> sa@openwinforms.com
> http://www.openwinforms.com/
> OpenWinForms - open source windows forms and controls
> Google group - http://groups.google.com/group/open-winforms
>
>
Similar Threads
-
By Application Development in forum Sharepoint
Replies: 0
Last Post: 12-17-2007, 09:59 AM
-
By Application Development in forum PHP
Replies: 4
Last Post: 10-31-2007, 09:42 PM
-
By Application Development in forum Sharepoint
Replies: 1
Last Post: 10-19-2007, 06:52 AM
-
By Application Development in forum XML SOAP
Replies: 3
Last Post: 01-08-2007, 01:53 PM
-
By Application Development in forum Graphics
Replies: 1
Last Post: 10-13-2006, 06:53 PM