Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

please correct script : prob with onclick eventHandler 1

Status
Not open for further replies.

JeroenB

Programmer
Apr 8, 2001
93
BE
Hi,

I have the following problem; hope someone can solve it:
When you click on the &quot;ok&quot; button, a new html page should open (in the same frame); the choice of your <select> box determines which page should open...
Everything seems ok in IE, but not in NS.
Is someone familiar with this problem and knows how I can solve it?

Thanks in advance
JeroenB

<html>
<head><title>Untitled</title>
</head>
<script language=&quot;javaScript&quot;>

function additem()
{
document.items.action = document.items.mediatype.options[document.items.mediatype.options.selectedIndex].value;
document.items.submit();
}

</script>
<body>
<form method=&quot;POST&quot; name=&quot;items&quot; action&quot;&quot;>
<table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;0&quot; width=&quot;375&quot;>
<tr>
<td width=&quot;65&quot; align=&quot;left&quot;><font class=&quot;text01&quot;>media type</font></td>
<td width=&quot;310&quot;><select name=&quot;mediatype&quot; size=&quot;1&quot; maxlength=&quot;&quot;>
<option value=&quot;photograph.html&quot;>Photographs</option>
<option value=&quot;plan.html&quot;>Architectural Drawings</option>
<option value=&quot;motionpicture.html&quot;>Motion Pictures</option>
<option value=&quot;soundrecord.html&quot;>Sound Recordings</option>
<option value=&quot;3dmodel.html&quot;>3D Models</option>
<option value=&quot;article.html&quot;>Articles</option>
<option value=&quot;book.html&quot;>Books</option>
<option value=&quot;nonpublished.html&quot;>Non-Published</option></select></td>
</tr><tr>
<td width=&quot;65&quot; align=&quot;left&quot;><font class=&quot;text01&quot;>section</font></td>
<td width=&quot;310&quot;><input type=&quot;text&quot; name=&quot;section&quot; size=&quot;30&quot; maxlength=&quot;40&quot;></td>
</tr><tr>
<td width=&quot;65&quot; align=&quot;left&quot;> <font class=&quot;text01&quot;>pavilion</font></td>
<td width=&quot;310&quot;><input type=&quot;text&quot; name=&quot;pavilion&quot; size=&quot;30&quot; maxlength=&quot;40&quot;></td>
</tr><tr>
<td width=&quot;65&quot; align=&quot;left&quot;><font class=&quot;text01&quot;>unit</font></td>
<td width=&quot;310&quot;><input type=&quot;text&quot; name=&quot;unit&quot; size=&quot;30&quot; maxlength=&quot;40&quot;></td>
</tr><tr>
<td width=&quot;65&quot; align=&quot;left&quot;>  </td>
<td width=&quot;310&quot;><input type=&quot;button&quot; value=&quot; ok &quot; OnClick=&quot;additem()&quot;></td>
</tr>
</table>

</FORM>
</body>
</html>
 
try calling the function onsubmit : <form name= method= onsubmit=&quot;javascript:additem()&quot;>
let me know
 
Hi JeroenB,

it's just because you forget the &quot;=&quot; on the action of your form !! :

<form method=&quot;POST&quot; name=&quot;items&quot; action=&quot;&quot;> and not <form method=&quot;POST&quot; name=&quot;items&quot; action&quot;&quot;>

IE don't take care of that thing but NS's not the same ...
Hope this helps ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top