Niklas Rosencrantz
Niklas Rosencrantz

Reputation: 26637

Why is this field undefined?

After I submit my form and return to the page, the field that does the submit displays the unwanted text "undefined":

enter image description here

How can I lose the text "undefined"? I do absolutely nothing to make it appear. This is the HTML:

<span class="small60">Nummer: 
<input onkeypress="javascript:searchWithEnter('Oversikt','fastsearch')" 
       title="<%=mouseOverFast %>" type="text" size="40" name="fastsearch">

The script:

function searchWithEnter(action, command) {
    if (window.event && window.event.keyCode == 13) {
        document.actionForm.action.value = 'Oversikt';
        document.actionForm.actionCommand.value = 'fastsearch';
        document.actionForm.submit();
        disableAll();

    }
}

Upvotes: 0

Views: 658

Answers (1)

undefined
undefined

Reputation: 2101

searchWithEnter tries to set the value of the field with an undefined variable.

EDIT: I don't see a value attribute for the input.

Upvotes: 1

Related Questions