Doubt in java script..??

Posted by Mohit007kumar00 under JavaScript on 9/24/2010 | Points: 10 | Views : 1216 | Status : [Member] | Replies : 3
Hello friends,
Anybody have idea how to store the vales inputed in a specified file using java script.
Let this program
<html>
<head>
<script type="text/javascript">
var p=prompt("enter your name");
</script>
</head>
</html>

here i want to store the name entered in a text file.
Any idea!!

mohit cboy hack the world


Responses

Posted by: SheoNarayan on: 9/24/2010 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Below code snippet should work in your scenario, I have tested and its working for me.

<asp:TextBox ID="txtBox1" runat="server" />

<input type="button" value="Click" onclick="PromptMe()" />
<script language="javascript" type="text/javascript">
function PromptMe() {
var v = prompt("Enter your name", "");
document.getElementById('<%= txtBox1.ClientID %>').value = v;
}
</script>


Hope this will work for you.

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Mohit007kumar00, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mohit007kumar00 on: 9/24/2010 [Member] Starter | Points: 25

Up
0
Down
I want to store the name or information entered from prompt in a .text file.
How this can be done.
I tried your code.
Isn't create any text file in which information is stored.

mohit cboy hack the world

Mohit007kumar00, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 9/24/2010 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Oops, sorry overlooked it, the solution will set the value in the TextBox. In order to store in the text file, you need to send this value into server side and store it.



Regards,
Sheo Narayan
http://www.dotnetfunda.com

Mohit007kumar00, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response