Welcome to WebmasterWorld Guest from 54.242.72.36

Forum Moderators: open

Message Too Old, No Replies

Javascript error, I can't figure it out

Help please

     

dididaman

7:57 pm on May 14, 2003 (gmt 0)

10+ Year Member



Why would this not work? I am getting the ol 'object does not support this property' error.

here is the html button:
<form name="form2"><table width=100% border=0 class="field"><tr><Td valign=bottom><b>Item #: &nbsp;</b>
<input type="text" size=9 name="quickSearch" value="0321233"><input type="button" value="Search" class="text" onClick="quickSearch();"></td>
<td valign=top nowrap>BATTERY HYDROMETER PROF.<BR> </td></tr><tr><td valign=top><a href="javascript:parent.pop_up('app?cmd=ItemDesc&itemSku=0321233', '672', '500');">Long Description</a></td>
</tr>
</table></form>

javascript:

<head><meta http-equiv="pragma" content="no-cache"></meta>
<title>Item Info</title>
<script language="JavaScript">
<!--
function quickSearch(){
alert(document.form2.quickSearch.value); }
//-->
</script>
<style type="text/css">
.field {font-size: 12px}
.title {font-size:14px; font-weight:bold}
.bd { border-style: solid; border-color: blue;}
.text { font-size: 9px ;}
</style>
</head>

mavherick

8:04 pm on May 14, 2003 (gmt 0)

10+ Year Member



Might not be it, but could the fact that your text box and function name are the same cause trouble? Did you try renaming your function to a different name?

Just a guess, I don't play much with Javascript.

mavherick

gph

9:58 pm on May 14, 2003 (gmt 0)

10+ Year Member



Yes mavherick is right. It would work as a string

document.getElementById('quickSearch').value

But without quotes it doesn't know it from the function name.

gph

10:08 pm on May 14, 2003 (gmt 0)

10+ Year Member



Thought I'd check and I'm wrong. It's still 2 document objects named quickSearch.

I guess change case in 1 of the names or use other characters.

nuts_spices

12:26 am on May 16, 2003 (gmt 0)

10+ Year Member



Yes You all are right the error is because the function and the object name are same. i changed the name and it all works fine.

Try This

<head><meta http-equiv="pragma" content="no-cache"></meta>
<title>Item Info</title>
<script language="JavaScript">
<!--
function quickSearch(){
alert(document.form2.quickSearch1.value); }
//-->
</script>
<style type="text/css">
.field {font-size: 12px}
.title {font-size:14px; font-weight:bold}
.bd { border-style: solid; border-color: blue;}
.text { font-size: 9px ;}
</style>
</head>
<BODY>
<form name="form2"><table width=100% border=0 class="field"><tr><Td valign=bottom><b>Item #:

&nbsp;</b>
<input type="text" size=9 name="quickSearch1" value="0321233"><input type="button" value="Search"

class="text" onClick="quickSearch();"></td>
<td valign=top nowrap>BATTERY HYDROMETER PROF.<BR> </td></tr><tr><td valign=top><a

href="javascript:parent.pop_up('app?cmd=ItemDesc&itemSku=0321233', '672', '500');">Long

Description</a></td>
</tr>
</table></form>
</BODY>

dididaman

12:58 pm on May 16, 2003 (gmt 0)

10+ Year Member



Yes thank you all....it works now...i never caught onto that.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month