my dog learned polymorphism*
The moose likes HTML, CSS and JavaScript and the fly likes URL parameter ~~howto ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "URL parameter ~~howto ?" Watch "URL parameter ~~howto ?" New topic
Author

URL parameter ~~howto ?

Alvin chew
Ranch Hand

Joined: Jan 08, 2004
Posts: 834
hi, i have a link problem which i couldn't solve, below as my page which contain 2 forms,



--------------------------------------------------------------------------------
[CODE]
<!-- Note that LEGEND.DIV's are "replicated" in all the "FieldSets" --><!-- FIRST FS --><FIELDSET ID=dv1 class="menu" style="display:inline"><LEGEND><DIV class=outer><A href="javascript:show(1);" onclick="this.blur()"><SPAN>New Campaign</SPAN></A></DIV><DIV class=outer><A href="javascript:show(2);" onclick="this.blur()"><SPAN>Campaign Query</SPAN></A></DIV></LEGEND> <!-- this is form for new company--><form name="formA" method="post" action="/actions/formA.do"> <p><fieldset><font color="#333333"><font size="5"><legend><font size="2"><strong>:: New Campaign::</strong></font></legend></font></font><table width="100%" border="0" bgcolor="#EAEAEA"> <tr> <td colspan="4">&nbsp;</td> </tr> <tr> <td width="10%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Campaign Code :</font></td> <td width="27%"> </font> <input name="cam_code" type="text" id="cam_code"></td> <td width="17%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Start Date :</font></td> <td width="46%"><input name="cam_start_day" type="text" id="cam_start_day" size="1" maxlength="2">/ <input name="cam_start_month" type="text" id="cam_start_month" size="1" maxlength="2">/<input name="cam_start_year" type="text" id="cam_start_year" size="2" maxlength="4"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">(dd/mm/yyy)</font> </td> </tr> <tr> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Campaign Name : </font></td> <td><font color="#333333"> <input name="cam_name" type="text" id="cam_name" size=35> </font></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">End Date :</font></td> <td> </a> <input name="cam_end_day" type="text" id="cam_end_day" size="1" maxlength="2">/<input name="cam_end_month" type="text" id="cam_end_month" size="1" maxlength="2">/<input name="cam_end_year" type="text" id="cam_end_year" size="2" maxlength="4"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">(dd/mm/yyy)</font></td> </tr> <tr> <td height="42"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Campaign Type :</font></td> <td><font color="#333333"> <select name="cam_type" id="cam_type"> <option value="email">Email</option> <option value="conference">Conference</option> <option value="banner">Banner Ads</option> <option value="advertisement">Advertisement</option> <option value="other">Other</option> </select> </font></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Expected Revenue :</font></td> <td> <input name="cam_revenue" type="text" id="cam_revenue"> <a href="#" onclick="MM_openBrWindow('view/cams/menupopup.html','','width=600,height=400')"> <input name="rio" type="submit" id="rio2" value="ROI Calculator"> </a> </td> </tr> <tr> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Campaign Status :</font></td> <td> </font><font color="#333333"> <select name="cam_status" id="cam_status"> <option value="plan">Planning</option> <option value="progress">In Progress</option> <option value="complete">Completed</option> </select> </font></td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Budget Amount :</font></td> <td> </font> <input name="cam_amount" type="text" id="cam_amount"></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Expected Response : </font></td> <td><input name="cam_response" type="text" id="cam_response" size="3"> <font size="2" face="Verdana, Arial, Helvetica, sans-serif">%</font></td> </tr> <tr> <td>&nbsp;</td> <td> </font></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Description :</font></td> <td colspan="3"> </font> <input name="cam_desc" type="text" id="cam_desc" size="80"></td> </tr> <tr> <td>&nbsp;</td> <td> </font></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> <font color="#333333">&nbsp;&nbsp;&nbsp;&nbsp; </font> </fieldset> &nbsp; </p> <br><center><input name="cam_submit" type="submit" id="cam_submit" value="Save"></center><br></form> </pre></FIELDSET> <!-- NEw Contact Form --><FIELDSET ID=dv2 class="menu" style="display:none"><LEGEND><DIV class=outer><A href="javascript:show(1);" onclick="this.blur()"><SPAN>New Campaign</SPAN></A></DIV><DIV class=outer><A href="javascript:show(2);" onclick="this.blur()"><SPAN>Campaign Query</SPAN></A></DIV></LEGEND> <!-- this is form for new contact--><form name="formB" method="post" action="/actions/formB.do"> <a href="#secondform"><a> <p><fieldset><font size="5"><legend><font size="2"><strong><font color="#333333">::Campaign Query ::</font></strong></font></legend></font><table width="100%" border="0" bgcolor="eaeaea"> <tr> <td colspan="4">&nbsp;</td> </tr> <tr> <td width="27%"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Campaign Code :</font></td> <td width="44%"><input name="cam_query_code" type="text" id="cam_query_code"></td> <td width="11%">&nbsp;</td> <td width="18%">&nbsp;</td> </tr> <tr> <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Campaign Name :</font></td> <td><input name="cam_query_name" type="text" id="cam_query_name" size="50"></td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table> &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; </fieldset> <center><input name="cam_search" type="submit" id="cam_search" value="Search"> <input name="cam_reset" type="reset" id="cam_reset" value="Reset"> </center></form>


--------------------------------------------------------------------------------



my problem is, let say the user enter data into second form which named as "formB", when user click on search button which named as "cam_search", the form will pass for processing, after process..it bring back user to second form ("formB" , but so far, it only go back to first form ..how to i solve it ?

i have put <a href="#secondform"></a> tag below of second form as shown in bold font

in the forward path, i put /thispage.jsp?#secondform , but it still not work ..anyone have idea ?

thank you !

[ September 21, 2004: Message edited by: Eric Pascarello ]
[ September 21, 2004: Message edited by: Eric Pascarello ]
Neeraj Vij
Ranch Hand

Joined: Nov 25, 2003
Posts: 315
Hi,

try by using body onload() function and give focus to required form name.

rgds,
Neeraj.
Alvin chew
Ranch Hand

Joined: Jan 08, 2004
Posts: 834
hi, Neeraj Vij, i 'm not sure on your idea, do you mind to guide me further ...i'm new in javascript ...anyway thank you for your suggest
Neeraj Vij
Ranch Hand

Joined: Nov 25, 2003
Posts: 315
Hi,
try this.. just chnage the form name in function where you would like to send the control.

plz. Replace xyz with OnLoad... it was giving error while posting reply.

cheers,
Neeraj.

<html>
<head>
<title>test by neeraj</title>
<script language="JavaScript">

function giveFocus(){

document.form2.input.focus();
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF" xyz="giveFocus()">

<form name="form1" action="xyz.jsp" method="get">
<input type="text" NAME="input">
<input type="submit" VALUE="Submit">
</form>

<form name="form2" action="xyz" method="get">
<input type="text" NAME="input">
<input type="submit" VALUE="Submit">
</form>



</body>
</html>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Moving to the HTML/Javascript forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URL parameter ~~howto ?
 
Similar Threads
tabbed form problem
problem with java lib
Access & Read Embedded Email Attachments From Existing Email Message
link problem
What happen to this Tabbed form ?