Results 1 to 9 of 9

Thread: How can I put input type="password" in prompt?[Resolved]

  1. #1

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    How can I put input type="password" in prompt?[Resolved]

    I tried <input type="password" name="prompt"/> and it wont work.
    I want the password I type in prompt will represent *.


    TIA.
    Last edited by mar_zim; Sep 16th, 2005 at 08:52 PM.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: How can I put input type="password" in prompt?

    <input type="password" name="prompt"/>

    What's the slash doing there?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476

    Re: How can I put input type="password" in prompt?

    Closing the Tag!
    Instead of doing
    <input></input>

    you can just write <input/>
    Thats valid!
    I tried this and it works for me :
    HTML Code:
    <HTML>
    	<HEAD>
    		<TITEL>Test</TITLE>
    	</HEAD>
    	<BODY>
    		<INPUT type="password" name="prompt" />
    	</BODY>
    </HTML>
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

  4. #4

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: How can I put input type="password" in prompt?

    Thanks sgt for replying.

    I think I didn't make it clear.
    What I want is when I type in prompt(inputbox in vb) it will filter the character to *.
    Code:
    HEAD>
    <SCRIPT language="JavaScript">
    <!--hide
    
    var password;
    <input type="password" name="prompt"??? />
    password=prompt('Please enter your password to view this page!',' ');
    
    if (password=="dead")
        alert('Password Correct! Click OK to enter!');
    else
       {
        alert('Your Dead');
        }
    //-->
    </SCRIPT>
    </HEAD>

  5. #5
    Hyperactive Member Sgt-Peppa's Avatar
    Join Date
    Mar 2003
    Location
    Munich - Germany
    Posts
    476

    Re: How can I put input type="password" in prompt?

    Ah Ok now I understand what you want to do! Open a JS Prompt that is supposed to act like an Inbox with type set to password.

    I am sorry, I dont know of a way to do this!

    Why dont you just create a form where a user can enter Username and Password. Looks better imho.

    Sorry for not being more of a help here!

    Stephan
    Keep Smiling - even if its hard
    Frankie Says Relax, wossname Says Yeah!
    wossname:--Currently I'm wearing a gimp suit and a parachute.
    C# - Base64 Blog

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: How can I put input type="password" in prompt?

    You cannot do that. Simple.

  7. #7

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: How can I put input type="password" in prompt?

    Quote Originally Posted by mendhak
    You cannot do that. Simple.
    So what are the other way of prompting an input box to ask password?
    Im sorry for stupidity, I'm very new at this thing.

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: How can I put input type="password" in prompt?

    It's not possible. End of discussion. Make a page that prompts for a password (not in a popup). Submit the page to the server. If it's correct, show the real page.

    Well, that's not entirely correct. It is possible by making the server emit a 401 - Authorization Required response. The typical way to do this is the .htaccess file in Apache. This will make the browser pop up a box asking for username and password.

    But it's not possible using JavaScript.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    Re: How can I put input type="password" in prompt?

    Quote Originally Posted by CornedBee
    It's not possible. End of discussion. Make a page that prompts for a password (not in a popup). Submit the page to the server. If it's correct, show the real page.

    Well, that's not entirely correct. It is possible by making the server emit a 401 - Authorization Required response. The typical way to do this is the .htaccess file in Apache. This will make the browser pop up a box asking for username and password.

    But it's not possible using JavaScript.
    Thanks for the good advice CornedBee. I think I just make a page that ask password and not pop up.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width