prompting 2 values

U

uoL

Hello,

I'd like to know how to prompt two values with prompt(); function.
I need to get things like 'pass' and 'user, 'article' and 'value', etc
... in a document and I dont want to make a whole html in a pop up to
do it ..

Thanks !
 
E

Erwin Moller

uoL said:
Hello,

I'd like to know how to prompt two values with prompt(); function.
I need to get things like 'pass' and 'user, 'article' and 'value', etc
.. in a document and I dont want to make a whole html in a pop up to
do it ..

Thanks !

Hi,

Prompt just gives 1 inputfield. Period.
So you'll have to make 2 prompts, giving the values in sequence.
Or let the user use some character as a seperator, eg:
article;value

Regards,
Erwin Moller
 
W

whiskey

You can't. So you'll have to make a whole html page.
Unless you require the user to type in a "somecharacter" delimited
string and then parse it. Like: "user, pass, article, value". Tho this
ain't an elegant solution.
 
U

uoL

thank you all !

I've made an html form, but i wonder how ftp access form work ..
because i've seen they prompt two values user and pass.
i'll try to research a little more if smb knows plz let me know

Thanks!
 
A

ASM

uoL a écrit :
Hello,

I'd like to know how to prompt two values with prompt(); function.
I need to get things like 'pass' and 'user, 'article' and 'value', etc

function quest() {
if( art=prompt('Article subject')) {
if(val=prompt('Search value')) {
{ alert(art+'\n'+val); return; }
}
alert('not correctly filled');
}
 
E

Erwin Moller

uoL said:
thank you all !

I've made an html form, but i wonder how ftp access form work ..
because i've seen they prompt two values user and pass.
i'll try to research a little more if smb knows plz let me know

Your ftp-program is not written in JavaScript.

Regards,
Erwin Moller
 
U

uoL

Erwin,

I ment when you enter a ftp site via web browser. the web browser
display some kind of prompt but with two value inputs.

Regards,
uoL
 
U

uoL

Thanks ! that might help ..
uoL a écrit :

function quest() {
if( art=prompt('Article subject')) {
if(val=prompt('Search value')) {
{ alert(art+'\n'+val); return; }
}
alert('not correctly filled');
}
 
E

Erwin Moller

uoL said:
Erwin,

I ment when you enter a ftp site via web browser. the web browser
display some kind of prompt but with two value inputs.

Same answer: Your webbrowser is not written in JavaScript, but C(++).

So the ftp-dialog is not created by JavaScript, but it is created by some
build-in function.

Regards,
Erwin Moller
 
W

whiskey

That prompt isn't accessible from JavaScript. Those things ar generated
by the browser when a page requires authentication (http
authentication, for instance).
 
U

uoL

Thank you all .. but i tell you I think javascript should give
programmers this feature of prompting more than one value .. It seems
is obviously usefull.. but I'm also sure there's a good reason for not
implementing such a thing.
Thanks again !
Regards,
uoL
 
W

whiskey

I'm also sure there's a good reason for not implementing such a thing.
I wouldn't be so sure about that, however I'm sure there aren't good
reasons to implement such things :)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top