Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java GUI
|
Java GUI Discussions specific to programming Java GUI.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java GUI section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2004, 08:32 AM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default how to have a selection of action pages for one fo

Is this correct? I want to have a selection of action to the form. I have a drop down where each option will send to a different page. But there seem to be bugs in the javascript.

Code:
function checkAll(form,cbox)
{
var ct;
if(cbox.checked == true)ct = true;
else if(cbox.checked == false)ct = false;
for(var i = 0; i < form.length; i++)
{
if(form[i].type=='checkbox')form[i].checked = ct;
}
}
function SetAction()
{
do some validation...
if (this is where your number checking validation goes)
{
return false //this will cancel submit
}
else
{
if (you want to go here)
{
document.form1.action = 'set to URL you want to go to';
document.form1.submit();
}
else
{
document.form1.action = 'set to other URL you want to go to';
document.form1.submit();
}
}
}
</SCRIPT>

...
<form align="center" method="get" 
onsubmit="java script: return SetAction();" 
action="<%=SCRIPT_SAVED%>" id=form1 name=form1>Select<br>
<select size="1" name="choices" id="choices">
<option SELECTED VALUE="">None</option> 
<option VALUE="001">Delete</option>
<option VALUE="002">Email to:</option>
<option VALUE="003">Print</option>
<option VALUE="004">Save in:</option>
</select><input type="submit" value="OK" name=submit1><br>
<input type='checkbox' onclick='javascript: checkAll(this.form.this);' value="check all" name="ck<%CStr(id)%>">
Select All</th>
...
<p><input type="checkbox" name="ck<%CStr(id)%>" value="<%=rs("id")%>"></p>
The CheckAll worked before inserting the second javascript. But when I inserted it it stopped working (checking all checkboxes)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Request action on change and get no action. Help crussell Ajax 0 September 12th, 2007 11:11 AM
FO Question macsmaker XSLT 5 September 4th, 2007 11:52 AM
XSL-FO NEO1976 XML 2 July 19th, 2006 10:10 AM
Web pages constructing: I-mode(mobile) pages karib Dreamweaver (all versions) 3 June 6th, 2004 09:48 AM
Report Heading Based On Selection Criteria Fo CloudNine Access 5 March 4th, 2004 08:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.