By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,688 Members | 1,900 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,688 IT Pros & Developers. It's quick & easy.

prompt

P: n/a
<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

Nov 30 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ASM
an*****@gmail.com 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>
--
Stephane Moriaux et son moins vieux Mac déjà dépassé
Stephane Moriaux and his less old Mac already out of date
Nov 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.