Menu
how do we implement a textbox in Javascript?
For example:
if (status == “other”) {
new textbox area ???
}
could anyone tell me about it? thank you very much
[i]Originally posted by handong888 [/i]Only if you can better explain yourself.
[B]could anyone tell me about it?[/B][/QUOTE]
[code=php]
bTag = document.getElementsByTagName("BODY");
newTextbox = document.createElement("INPUT");
newTextbox.type = 'text';
bTag[0].appendChild(newTextbox);
[/code]
[i]Originally posted by Elegidito [/i]Bad, very bad. The one in ten users who do not use JavaScript will not be able to properly use the form, try this method instead:
[B]I think I'm feeling clairvoyant today, do you mean something like this:
[code=php]
bTag = document.getElementsByTagName("BODY");
newTextbox = document.createElement("INPUT");
newTextbox.type = 'text';
bTag[0].appendChild(newTextbox);
[/code]
hope that helps [/B][/QUOTE]
if (status == "Visa") {
}
else if (status == "Mastercard") {
}
else if (status == "American Express") {
}
else if (status == "Discover Card") {
}
else if (status == "Macy") {
}
else if (status == "Kohl") {
}
else if (status == "Sears") {
}
else if (status == "JC Penney") {
}
else if (status == "Other") {
}
[i]Originally posted by handong888 [/i]Cut and paste my code and you will see that it does exactly what you ask. I cannot adapt it to your needs because you are trying to make a JavaScript dependent page. And that is very bad.
[B]hi Charles:
I am not sure how do I try your code, because I do not understand it right now. I do not see your code will produce a new textbox which I show it on the page when I choose "other". I want to change the code so when I select every single value in the dropdown menu, the page will be the same except when I select the last single value(other), the page will have a textbox appear on the page. how can I do that? please help me. thank you [/B][/QUOTE]
[i]Originally posted by handong888 [/i]Yes, I know. When you have a page that will still work without JavaScript, one where JavaScript adds just a litle fluff, then let me know. Until then, perhaps someone else can help you.
[B]I am currently have something like this...[/B][/QUOTE]
0.1.9 — BETA 5.18