Forum Moderators: open
is closed, so I write here:
The password field isn't handle by the script, I added:
case "password":
function create_request_string(theform)
{
var reqStr = "";for(i=0; i < theform.elements.length; i++)
{
isformObject = false;
if (theform.elements[i].tagName == "INPUT")
{
switch (theform.elements[i].type)
{
case "text":
case "hidden":
case "password":
reqStr += theform.elements[i].name + "=" + theform.elements[i].value;
isformObject = true;
break;
case "checkbox":
if (theform.elements[i].checked)
{
reqStr += theform.elements[i].name + "=" + theform.elements[i].value;
}else{
reqStr += theform.elements[i].name + "=";
}
isformObject = true;
break;
case "radio":
if (theform.elements[i].checked)
{
reqStr += theform.elements[i].name + "=" + theform.elements[i].value;
isformObject = true;
}
}
}
if (theform.elements[i].tagName == "SELECT")
{
var sel = theform.elements[i];
reqStr += sel.name + "=" + sel.options[sel.selectedIndex].value;
isformObject = true;
}
if ((isformObject) && ((i+1)!= theform.elements.length))
{
reqStr += "&";
}
}
return reqStr;
}
function create_request_string(theform) {
var reqStr = "";
var el, i, isformObject;
for(i = 0; i < theform.elements.length; i++) {
isformObject = false;
el = theform.elements[i];
if (el.tagName == "INPUT") {
switch (el.type) {
case "text":
case "hidden":
case "password":
reqStr += el.name + "=" + el.value;
isformObject = true;
break;
case "checkbox":
if (el.checked) {
reqStr += el.name + "=" + el.value;
} else {
reqStr += el.name + "=";
}
isformObject = true;
break;
case "radio":
if (el.checked) {
reqStr += el.name + "=" + el.value;
isformObject = true;
}
break;
}
}
if (el.tagName == "SELECT") {
reqStr += el.name + "=" + el.options[el.selectedIndex].value;
isformObject = true;
}
if ((isformObject) && ((i + 1)!= theform.elements.length)) {
reqStr += "&";
}
}
return reqStr;
}
[quote][pre]
function foo() {
....alert('foo');
....// No blank lines...
}
[/pre][/quote]
Note, replace the . with spaces (since I'm disabling codes for this message, the above example will not be formatted, so I used . to represent my leading whitespace). Also note that this BB will still trim down the spaces. For every 2 whitespace characters, only 1 will show up. So if I use 4 spaces, it gets published as 2 spaces. If I then edit that message, it will only have 2 spaces where there was once 4, so if I save it, then I'll only have 1 space... so you need to use care when editing a message you already posted.
:-)
[1][[b]edited by[/b]: Fotiman at 3:51 pm (utc) on Nov. 16, 2007][/1]