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

Javascript and Web Form

Status
Not open for further replies.

Amrodg

Technical User
Joined
Jan 26, 2006
Messages
1
Location
US
So I pretty much a form that When you click submit shows you the data in a new window. I cannot figure out how to make multiple things show up if I am using a option box with multiple=yes on. Anyone have any ideas?


<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
function display() {
DispWin = window.open ('','NewWin')
message += "font&#45;style&#58;" + document.test.lbt8fontstyle.value + "&#59<BR>";
DispWin.document.write(message);
}
</SCRIPT>
</HEAD>

<BODY>

<form name="test">

Text Style:
<select name=lbt8fontstyle multiple=yes>
<option value="Normal">Normal</option>
<option value="Italic">Italic</option>
<option value="Oblique">Oblique</option>
</select><BR><BR>
<INPUT type="button" value="display" onClick="display();">


Thanks,
Amrodg
 
Do you mean the popup window should show more info if you have options on the main form checked?

You can pass parameters on the URL to the new page when you open it and use script inside to read those values to know what to display, or you can read the values of the options selected on the parent window to determine what to display.


Stamp out, eliminate and abolish redundancy!
 
You need to loop around all the options checking to see which are selected. For a select element with the multiple attribute set, testing the value attribute is not the way to go.

Hope this helps,
Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top