homepage Welcome to WebmasterWorld Guest from 54.196.195.158
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
javascript problem
christogray




msg:1490584
 11:05 pm on Jun 9, 2002 (gmt 0)

I am trying to use a jumpmenu which is located in a sideframe, to submit the value of the selected option using POST to a Java Server Page - Store.jsp. This should then open in the main frame in the middle, however I don't know how to open the jsp in the middle frame, it keeps on opening in the side frame which should remain the same.

any help appreciated.

my snippets of code look like this:

// here is the function which should open
// store.jsp in the main frame.

function jumpPage(form) {

var i = form.SelectMenu.selectedIndex;
if (i == 0) return;

form.submit(); // this currently opens
// Store.jsp
// in the side frame, which is
// incorrect.

}

....

<FORM Name="selectionForm" ACTION="Store.jsp" METHOD=POST >

....

<SCRIPT>
function MakeArray()
{
this.length = MakeArray.arguments.length
for (var i = 0; i < this.length; i++)
this[i+1] = MakeArray.arguments[i]
}

var siteopt = new MakeArray("Roland",
"Novation",
"Korg",
"Nord",
"Clavia",
"Access");

var url = new MakeArray("",
"Store.jsp",
"Store.jsp",
"Store.jsp",
"Store.jsp",
"Store.jsp");

document.writeln('<FORM><SELECT NAME="SelectMenu" onChange="jumpPage(this.form)">');
tot = siteopt.length;
for (var i = 1; i <= tot; i++)
document.write("<OPTION>" +siteopt[i]);
document.writeln('</SELECT>');
document.writeln('</FORM>');

</SCRIPT>

 

papabaer




msg:1490585
 11:25 pm on Jun 9, 2002 (gmt 0)

Hello christogray,

Welcome to Webmaster World!
How are you building your <select><option> menu? And how are you targeting the frame?

christogray




msg:1490586
 12:10 am on Jun 10, 2002 (gmt 0)

Thanks for the reply,

This part creates the select option dropdown menu

<SCRIPT>
function MakeArray()
{
this.length = MakeArray.arguments.length
for (var i = 0; i < this.length; i++)
this[i+1] = MakeArray.arguments[i]
}

var siteopt = new MakeArray("Roland",
"Novation",
"Korg",
"Nord",
"Clavia",
"Access");

var url = new MakeArray("", //this url array is
//not actually needed.
"Store.jsp",
"Store.jsp",
"Store.jsp",
"Store.jsp",
"Store.jsp");

document.writeln('<FORM><SELECT NAME="SelectMenu" onChange="jumpPage(this.form)">');
tot = siteopt.length;
for (var i = 1; i <= tot; i++)
document.write("<OPTION>" +siteopt[i]);
document.writeln('</SELECT>');
document.writeln('</FORM>');

</SCRIPT>


I do not know how to target the middle frame with the form.submit(), this is what I'd like to do.
Say the middle frame is called middle.htm, how do I get the jsp page to appear in this when the user selects an option

I'm quite new to javascript programming and have done my website development using sample code for the most part.

again, any help appreciated.

rewboss




msg:1490587
 11:28 am on Jun 10, 2002 (gmt 0)

I suggest trying a target attribute in the <form> element, just like you would use it for an <a> element.

No guarantees, though -- I've never tried it myself.

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