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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JavaScript Input Box / Window.prompt

Status
Not open for further replies.

vikaskalra

Technical User
Aug 12, 2002
41
GB
Dear friends,

I have a typical problem, in a Book - Pure JavaScript, I read that window.promt('Message','Default Value') can be used to get user input, using JavaScript.

The problem that I am facing right now is, although it does everything as desired, but in the Input Box that is displayed, it also places an ugly statement : "JavaScript Prompt:" ahead of the Message that I want to display.

This is kind of annoying for any user input.

Please suggest me some alternative so that only the Message that I want to display is placed and the user Inputs the Value.

Any help will be greatly appreciated,
Thanx in Adance,
Vikas
 
as far as I'm a where you can not take out the
script Prompt:
in a prompt
that is the line you are refering to correct. You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
I don't know how you did it, but in IE 6.0, this gives the desired effect:

<script>
<!--
function add(){
var pr=prompt(&quot;A Q.&quot;,&quot;The A.&quot;);
text1.value=pr;
}
//-->
</script>
<body onLoad=&quot;add();&quot;>
<input type=&quot;text&quot; id=&quot;text1&quot;>
</body>

Rick if(($question==&quot;has been bugging me&quot;
AND $answer==&quot;fixed the problem&quot;) OR $answer==&quot;really good post&quot;){
print(&quot;Star&quot;);
}else{
print(&quot;Thanks.&quot;);
}
 
I think what was wanting to be taken out was the
_______________________________________________________
Explorer User Prompt
_______________________________________________________
Script Prompt


correct? I'm feeling alittle stupid if I missed that.[lol] You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
Hi Rick,

I am using IE 5, and have to stick with IE 5 alone... cause it is mandatory for me !

I did the same stuff, u suggested but the &quot;JavaScript Prompt:&quot; did appear !

Thanx anyway for a quick response,
Vikas
 
Dear onpnt,

I am using IE 5. Actually when I used prompt, a text is displayed saying &quot;JavaScript Prompt:&quot; just above the message that I wanted to be displyed, so that the usr knows what I am asking for.
I guess we can' remove this info, so is there any other alternative ??
Or I should make a second form pop up ??

Thanx for your inputs,
Vikas
 
As I said before you can't get rid of that line of text. I know what your saying. your javascript prompt is the same as my script prompt. If you want to, you can create a popup with a form input to get your value but you're going thru alot jsut to get rid of that formatting. I never had a issue or my clients with the prompt text being there.
Just my thoughts though.

javascript does not leave much room to adjusting the formatting of the alert, comnfirm, and prompts. Other languages give you some leway but not here. You cannot mandate productivity, you must provide the tools to let people become their best.
-Steve Jobs
admin@onpntwebdesigns.com
 
Hi,
Sorry, I misunderstood the question. i thought you said that the script: was displaying in the text input.

You can change that with VBScript. I am pretty sure.

I can send you a link if you are interested.

Rick if(($question==&quot;has been bugging me&quot;
AND $answer==&quot;fixed the problem&quot;) OR $answer==&quot;really good post&quot;){
print(&quot;Star&quot;);
}else{
print(&quot;Thanks.&quot;);
}
 
Hi Rick,
I know how to do that with VBScript.

Thanks anyway for all the help u have extended.

Vikas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top