homepage Welcome to WebmasterWorld Guest from 54.237.54.83
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Javascript error, I can't figure it out
Help please
dididaman




msg:1470841
 7:57 pm on May 14, 2003 (gmt 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>

 

mavherick




msg:1470842
 8:04 pm on May 14, 2003 (gmt 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




msg:1470843
 9:58 pm on May 14, 2003 (gmt 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




msg:1470844
 10:08 pm on May 14, 2003 (gmt 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.

nuts_spices




msg:1470845
 12:26 am on May 16, 2003 (gmt 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>

dididaman




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved