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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape compatible javascript

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
I have written this javascript code, which I Was testing under IE, and working with interdev6 for ActiveServer Page<br><br>this is the only client-side script I need to use<br>unfortunatly it seems that netscape is unable to change a form value through javascript.<br>and I dont want to create a single form for each&nbsp;&nbsp;input (since they're could be millions, different values)<br>the menu frame I can however make seperate forms, since it's only three choices.<br><br><FONT FACE=monospace><br>&lt;Script Language=&quot;JavaScript&quot;&gt;<br>&lt;!--<br> function Go(thePath)<br> {<br> DrvFrm.Path.value = thePath;<br> DrvFrm.submit();<br> }<br>--&gt;<br>&lt;/Script&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;Form name=&quot;DrvFrm&quot; action=&quot;DriveNav.asp&quot; method=&quot;post&quot; target=&quot;_display&quot;&gt;<br> &lt;input type=&quot;hidden&quot; name=&quot;Path&quot;&gt;<br>&lt;/Form&gt;<br></font><br><br>any help is appreciated. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
i'm not sure that the problem is on the value : i had almost the same stuff and finally found out that the form.submit() wasn't doing anything<br>dunno if it's the case for you tho ???
 
the submit wont do anything for netscape it seems, I tried it on my menu frame, by making a form for each 3 tasks, then trying to just do an onclick , call the javascript and submit it, nothing happened, so for the menu frame, I just have a button to submit the preset data, cant seem to figure out how to use it dynamically with netscape, I'll need to figure out how to repost a form to an ASP and still have it work dynamically in Netscape. <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Dear iza and Karl,<br><br>This works fine for me on Win95, Win98, NT4 running Nutscrap 4.72<br><br>&lt;Script language=javascript&gt;<br>&lt;!--<br>function dosubmit(){<br><br>&nbsp;&nbsp;document.form1.param1.value = &quot;1&quot;;<br>&nbsp;&nbsp;document.form1.submit();<br>}<br>--&gt;<br>&lt;/script&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY topmargin=0 leftmargin=0&gt;<br>&lt;form name=&quot;form1&quot; action=&quot;junk.asp&quot; method=&quot;post&quot;&gt;<br>&lt;input name=&quot;param1&quot; id=&quot;param1&quot; value=&quot;0&quot; type=&quot;text&quot;&gt;&lt;br&gt;<br>&lt;input type=&quot;button&quot; onclick=&quot;dosubmit()&quot; value=&quot;Submit&quot;&gt;<br>&lt;/form&gt;<br><br>Hope this helps<br>-pete<br>
 
I've done exactly what you had, and I am using 4.73 of nutscrape(hehe) and no go. here is the script info:<br><br><FONT FACE=monospace><br>&lt;Script Language=&quot;JavaScript&quot;&gt;<br>&lt;!--<br> function Go(thePath)<br> {<br> document.DrvFrm.Path.value = thePath;<br> document.DrvFrm.submit();<br> }<br>--&gt;<br>&lt;/Script&gt;<br>&lt;/HEAD&gt;<br>&lt;BODY&gt;<br>&lt;Form name=&quot;DrvFrm&quot; action=&quot;DriveNav.asp&quot; method=&quot;post&quot; target=&quot;_display&quot;&gt;<br> &lt;input type=&quot;hidden&quot; name=&quot;Path&quot;&gt;<br>&lt;/Form&gt;<br></font><br><br>an example of the code that calls the script(server-side code)<br><br><br><FONT FACE=monospace><br>...<br>For Each fol in fsSub<br>&nbsp;&nbsp;&nbsp;thepath = replace(fol.path,&quot;\&quot;, &quot;\\&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%&gt;&lt;TR&gt;&lt;%=vbcrlf & vbTab%&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD onclick=&quot;Go('&lt;%=thepath%&gt;');&quot; bgcolor=#20b2aa&gt; &lt;IMG SRC=&quot;images/Folder.jpg&quot; width=16 height=16&gt; &lt;%=fol.name%&gt; &lt;/TD&gt; &lt;%=vbcrlf & vbtab%&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;%=vbcrlf%&gt;<br>&nbsp;&nbsp;&nbsp;&lt;/TR&gt;&lt;% Response.Write vbcrlf<br>next<br>...<br></font><br><br>what the code looks like to the browser( or what is actually sent back from the server when request for the ASP is made )<br><br><FONT FACE=monospace><br>...<br>&lt;TR&gt;<br>&lt;TD onclick=&quot;Go('Root');&quot; bgcolor=#20b2aa&gt;&lt;IMG SRC=&quot;images/Folder.jpg&quot; width=16 height=16&gt;..&lt;/TD&gt;<br>&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;<br>&lt;/TR&gt;<br>&lt;TR&gt;<br>&lt;TD onclick=&quot;Go('C:\\Downloads');&quot; bgcolor=#20b2aa&gt; &lt;IMG SRC=&quot;images/Folder.jpg&quot; width=16 height=16&gt; Downloads &lt;/TD&gt; <br>&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;<br>&lt;/TR&gt;<br>&lt;TR&gt;<br>&lt;TD onclick=&quot;Go('C:\\GSPrv');&quot; bgcolor=#20b2aa&gt; &lt;IMG SRC=&quot;images/Folder.jpg&quot; width=16 height=16&gt; GSPrv &lt;/TD&gt; <br>&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;&lt;TD&gt; &lt;/TD&gt;<br>&lt;/TR&gt;<br>&lt;TR&gt;<br>&lt;TD onclick=&quot;Go('C:\\InetPub');&quot; bgcolor=#20b2aa&gt; &lt;IMG SRC=&quot;images/Folder.jpg&quot; width=16 height=16&gt; InetPub &lt;/TD&gt; <br>...<br></font> <p>Karl<br><a href=mailto:kb244@kb244.8m.com>kb244@kb244.8m.com</a><br><a href= </a><br>Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)
 
Dear Karl,<br><br>Netscape only supports the 'onclick' event in 'button' type input tags like I used in my example.<br><br>The only other way to call a script is to use the event model, which I don't know and don't want to know, OR use an anchor tag like this:<br><br><a href="javascript:Go('whatever');">Go here</a><br><br>Hope this helps<br>-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top