prompt

A

andwing

<form method="post" name="folder" id="folder">
<input type="hidden" name="name" value="" />
<input name="submit" type="hidden" value="new name .."
onclick="getname();" />

function getname ()
{
document.folder.name.value =
prompt ('welcome: ', 'default');

alert (prompt);

if ( document.folder.name.value == ""
|| document.folder.name.value == null)
document.folder.name.value = 'default';
}

This script after end (works correctly) alert the message

function prompt() { [native code] }

What is this? How to correct?
OS freebsd, browser opera

10x
 
A

ASM

(e-mail address removed) a écrit :
<form method="post" name="folder" id="folder">
<input type="hidden" name="name" value="" />

Never give 'name' as name to an element ! :-(
In same way try to do not use 'submit' as name.
<input name="submit" type="hidden" value="new name .."
onclick="getname();" />

<form onsubmit="return false">
<input type="button" name="aName" value="">
<input type="button" value="set name"
onclick="
var newName = prompt('welcome: ', 'default');
this.form.aName.value = newName? newName : 'default';
">
</form>
 

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

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top