Welcome to WebmasterWorld Guest from 23.20.193.33

Forum Moderators: open

Message Too Old, No Replies

Javascript error, I can't figure it out

Help please

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

New User

10+ Year Member

joined:May 14, 2003
posts:3
votes: 0


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>

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

Junior Member

10+ Year Member

joined:June 3, 2002
posts:169
votes: 0


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)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


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)

Full Member

10+ Year Member

joined:Jan 31, 2002
posts:285
votes: 0


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.

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

New User

10+ Year Member

joined:May 15, 2003
posts:8
votes: 0


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>

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

New User

10+ Year Member

joined:May 14, 2003
posts:3
votes: 0


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

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members