Can I enter data into a PROMPT and have it open a window based on the value entered?

Discussion in 'Javascript' started by Tom Jenkins, Sep 26, 2004.

  1. Tom Jenkins

    Tom Jenkins Guest

    I have looked at many JavaScripts and I cannot seem to find exactly
    what I am looking for. It might be so simple that it went right over
    my head but on the other hand, I am not sure if this can be done using
    JavaScript.

    I currently have a photo restoration/retouching website. I normally
    send my customers an email containing a proof of the retouched
    photograph for their approval. Instead of emailing them the proof, I
    would like them to be able to access their proof from my website. When
    the photo is ready for approval, I would create an html page based on
    the customer's telephone number and send them an email cotaining a
    link to my website.
    The customer would then access my web page called "customer proofs"
    (for example). On that page, they would enter their telephone number
    and after pressing enter, the popup window that I created previoulsy
    will open, displaying the retouched photograph.
    Is this possible to do with JavaScript or would I need to create some
    type of database on my web server?

    Thanks
    Tom
    Tom Jenkins, Sep 26, 2004
    #1
    1. Advertising

  2. Tom Jenkins

    Randy Webb Guest

    Re: Can I enter data into a PROMPT and have it open a window basedon the value entered?

    Tom Jenkins wrote:

    > I have looked at many JavaScripts and I cannot seem to find exactly
    > what I am looking for. It might be so simple that it went right over
    > my head but on the other hand, I am not sure if this can be done using
    > JavaScript.


    phoneNumber=prompt('Whats your phone number?','###-###-####');
    document.location.href= 'http://pathToFiles/' + phoneNumber + '.html';



    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Sep 26, 2004
    #2
    1. Advertising

  3. Tom Jenkins

    Evertjan. Guest

    Randy Webb wrote on 26 sep 2004 in comp.lang.javascript:

    > Tom Jenkins wrote:
    >
    >> I have looked at many JavaScripts and I cannot seem to find exactly
    >> what I am looking for. It might be so simple that it went right over
    >> my head but on the other hand, I am not sure if this can be done using
    >> JavaScript.

    >
    > phoneNumber=prompt('Whats your phone number?','###-###-####');
    > document.location.href= 'http://pathToFiles/' + phoneNumber + '.html';


    Why do I get the feeling you think this is not an multinational NG ?


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Sep 26, 2004
    #3
  4. Tom Jenkins

    Fred Oz Guest

    Re: Can I enter data into a PROMPT and have it open a window basedon the value entered?

    Tom Jenkins wrote:
    [snip]
    > ... Instead of emailing them the proof, I
    > would like them to be able to access their proof from my website. When
    > the photo is ready for approval, I would create an html page based on
    > the customer's telephone number and send them an email cotaining a
    > link to my website.
    > The customer would then access my web page called "customer proofs"
    > (for example). On that page, they would enter their telephone number
    > and after pressing enter, the popup window that I created previoulsy
    > will open, displaying the retouched photograph.

    [snip]

    Why not use some randomly generated string to make the URL unique?
    Something like "pageZX76jiX.hmtl" then include the link in the e-mail.
    Your users then click on the link in the email (or copy and paste it)
    to view the page.

    Other issues this approach addresses:

    1. How will you create multiple pages for a single customer that has
    only one phone number?

    2. How do you stop clients from entering other clients' phone numbers
    to access their images?

    To make your site much more secure, have you considered adding
    usernames & passwords?

    Cheers, Fred.
    Fred Oz, Sep 26, 2004
    #4
  5. Tom Jenkins

    Tom Jenkins Guest

    Randy Webb <> wrote in message news:<>...
    > Tom Jenkins wrote:
    >
    > > I have looked at many JavaScripts and I cannot seem to find exactly
    > > what I am looking for. It might be so simple that it went right over
    > > my head but on the other hand, I am not sure if this can be done using
    > > JavaScript.

    >
    > phoneNumber=prompt('Whats your phone number?','###-###-####');
    > document.location.href= 'http://pathToFiles/' + phoneNumber + '.html';



    Thanks Randy - that is what I was looking for.
    Fred: I know I can send an email with a link to a web page but I
    wanted to set it up as described. As far as other users accessing
    other photos that is not a problem and setting up a userid/password
    system is not necessary at this time.

    Thanks again.

    Tom
    Tom Jenkins, Sep 27, 2004
    #5
  6. Tom Jenkins

    Randy Webb Guest

    Re: Can I enter data into a PROMPT and have it open a window basedon the value entered?

    Evertjan. wrote:

    > Randy Webb wrote on 26 sep 2004 in comp.lang.javascript:
    >
    >
    >>Tom Jenkins wrote:
    >>
    >>
    >>>I have looked at many JavaScripts and I cannot seem to find exactly
    >>>what I am looking for. It might be so simple that it went right over
    >>>my head but on the other hand, I am not sure if this can be done using
    >>>JavaScript.

    >>
    >>phoneNumber=prompt('Whats your phone number?','###-###-####');
    >>document.location.href= 'http://pathToFiles/' + phoneNumber + '.html';

    >
    >
    > Why do I get the feeling you think this is not an multinational NG ?


    Of course, you are correct that ###-###-#### is not a uniquely
    multinational format, but to date, I do not know of a multinational
    format that is recognizable. I do assume that when people see "Whats
    your phone number?" that they can reasonably assume I wanted a phone
    number, even if the preexisting text is of a format that is foreign to them.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq
    Randy Webb, Sep 29, 2004
    #6
  7. JRS: In article <>, dated Wed, 29 Sep
    2004 12:28:46, seen in news:comp.lang.javascript, Randy Webb
    <> posted :
    >Evertjan. wrote:
    >> Randy Webb wrote on 26 sep 2004 in comp.lang.javascript:
    >>>Tom Jenkins wrote:
    >>>
    >>>>I have looked at many JavaScripts and I cannot seem to find exactly
    >>>>what I am looking for. It might be so simple that it went right over
    >>>>my head but on the other hand, I am not sure if this can be done using
    >>>>JavaScript.
    >>>
    >>>phoneNumber=prompt('Whats your phone number?','###-###-####');
    >>>document.location.href= 'http://pathToFiles/' + phoneNumber + '.html';

    >>
    >>
    >> Why do I get the feeling you think this is not an multinational NG ?

    >
    >Of course, you are correct that ###-###-#### is not a uniquely
    >multinational format, but to date, I do not know of a multinational
    >format that is recognizable. I do assume that when people see "Whats
    >your phone number?" that they can reasonably assume I wanted a phone
    >number, even if the preexisting text is of a format that is foreign to them.


    That display implies that the number is required to be ###-###-####, and
    that the page has been written either purely for NA landline numbers, or
    by a NAian who does not know any better. Or, of course, that the author
    supposes that apart from NA landliners everyone will understand "Whats
    your phone number?" (in spite of the missing apostrophe), but NA
    landliners need further assistance.


    Whenever a phone number is asked for, there should be an indication of
    whether a local, national, or international number is expected. My
    landline number could be +44 020 #### ####, or 020 #### ####, or just
    #### ####, depending on context; and I have no idea what variation there
    may be in mobile number formats.

    --
    © John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
    Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links.
    Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036)
    Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036)
    Dr John Stockton, Sep 30, 2004
    #7
  8. Tom Jenkins

    Lee Guest

    Evertjan. said:
    >
    >Randy Webb wrote on 26 sep 2004 in comp.lang.javascript:
    >
    >> Tom Jenkins wrote:
    >>
    >>> I have looked at many JavaScripts and I cannot seem to find exactly
    >>> what I am looking for. It might be so simple that it went right over
    >>> my head but on the other hand, I am not sure if this can be done using
    >>> JavaScript.

    >>
    >> phoneNumber=prompt('Whats your phone number?','###-###-####');
    >> document.location.href= 'http://pathToFiles/' + phoneNumber + '.html';

    >
    >Why do I get the feeling you think this is not an multinational NG ?


    This group is multinational, but relatively few web sites created
    within the US are intended for multinational use. OP posted from
    the US.
    Lee, Sep 30, 2004
    #8
  9. Tom Jenkins

    Evertjan. Guest

    Dr John Stockton wrote on 30 sep 2004 in comp.lang.javascript:
    > landline number could be +44 020 #### ####, or 020 #### ####,


    +44 20

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Sep 30, 2004
    #9
  10. Tom Jenkins

    Evertjan. Guest

    Lee wrote on 30 sep 2004 in comp.lang.javascript:
    >>Why do I get the feeling you think this is not an multinational NG ?

    >
    > This group is multinational, but relatively few web sites created
    > within the US are intended for multinational use. OP posted from
    > the US.


    That is not why I get the feeling ;-}



    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress,
    but let us keep the discussions in the newsgroup)
    Evertjan., Sep 30, 2004
    #10
  11. Tom Jenkins wrote:

    > Randy Webb [...] wrote [...]:


    Please do not post attribution novels.

    >> phoneNumber=prompt('Whats your phone number?','###-###-####');
    >> document.location.href= 'http://pathToFiles/' + phoneNumber + '.html';

    >
    > Thanks Randy - that is what I was looking for.


    However, document.location is deprecated, use window.location or just
    location instead.


    PointedEars
    Thomas 'PointedEars' Lahn, Oct 10, 2004
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TN Bella
    Replies:
    1
    Views:
    1,484
    TN Bella
    Jul 1, 2004
  2. Replies:
    2
    Views:
    4,902
    Alex Homer
    Dec 17, 2004
  3. Replies:
    1
    Views:
    348
    =?Utf-8?B?cmFqYW1hbmlja2Ft?=
    Dec 17, 2004
  4. sojin
    Replies:
    12
    Views:
    1,864
  5. HopfZ
    Replies:
    0
    Views:
    542
    HopfZ
    Aug 28, 2006
Loading...

Share This Page