Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components 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 January 4th, 2005, 10:55 PM
Authorized User
 
Join Date: Nov 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vanjamier Send a message via AIM to vanjamier Send a message via MSN to vanjamier Send a message via Yahoo to vanjamier
Default Is it possible to have 2 FORM tags?

Hi, I have a problem using my "find" BUTTON. It doesnt respond...
i have 2 submit btn's so i decided to use 2 forms
It appears the problem isnt solve tht easy..

Please kindly take a look at my code and let me know my mistake cuz i dont..
Thanks in advance.
Code:
<%@LANGUAGE="VBSCRIPT"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">
function checkEmail(form1) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form1.owneremail.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}
</script>
</head>

<body onload="document.form2.swname.value=document.form2.option1.options[document.form2.option1.selectedIndex].value">
 <form method="post" enctype="multipart/form-data" action="Insert_data.asp" name=form1 onSubmit="return checkEmail(this)">
 <table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">
 <tr>
 <td><b>Item</b></td>
 <td><b>Entries</b></td>
 </tr>
 <tr>
  <td>Software Owner :</td>
  <td><input name="ownername" size="40" ></td>
 </tr>
 <tr>
  <td>Software Email :</td>
  <td><input name="owneremail" size="40" ></td>
 </tr>
 <tr>
  <td>Software name :</td>
  <td><input name="swname" size="18">
  <form method="post" action="license_add.asp" name=form2>
  <input type="submit" name="Submit2" id="Submit3" value="Find"></td>
 </tr>
 <%  
        If Request.Form("Submit2") = "Find" Then
      description = Request.Form("swname")

  set rs=Server.CreateObject("ADODB.Recordset")

  sql= "select id,description from standard_sw where description like '" & description & "%'" &_           
       " union " &_
       " select id,name from legacy_sw where name like '" & description & "%'" 

  rs.Open sql,connStr

  response.write "<select id='option1' size='1' name='option1' onchange='this.form.text1.value=this.options[this.selectedIndex].value'>"
  while not rs.EOF
    response.write("<option value='") 
  response.write(rs.fields("description")) 
                response.write("'") 

   if rs.fields("description")= description then
     response.write("selected")
   end if

    response.write(">")
    response.write(rs.fields("description"))
    response.write("</option>")

    rs.MoveNext
  wend

      response.write "</select>"
  rs.Close
  set rs=Nothing 
 End if
  %>
   </form>
 </tr>
 <tr>
  <td></td>
  <td><input type="submit" value="Submit" id=submit1 name=submit1 onclick="verify();"></td>
 </tr>
 </table>
 </form>
</body>
</html>
Thanks in advance
__________________
Education ruined me
 
Old January 5th, 2005, 12:09 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Can you ellaborate on what you want achieve with this piece of code?
For your information .. we can have multiple submit buttons within a "single" form tag itself.

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old January 5th, 2005, 12:11 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel
Default

Btw a page can have many "Form" tags but they can't be nested.

Best Regards
Vadivel

MVP ASP/ASP.NET
http://vadivel.thinkingms.com
 
Old January 5th, 2005, 01:20 AM
Authorized User
 
Join Date: Nov 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vanjamier Send a message via AIM to vanjamier Send a message via MSN to vanjamier Send a message via Yahoo to vanjamier
Default

The page is a fill up application form.

The javascript validates email field.
In the software name field.
The find btn will search for a software based on the input keyed in the textfield.
The results will be displayed in a combo box
This works, i have tested it separately but the problem was started when i integrated it with another
asp.

I assume the submit btn is conflicted..
thats why the find btn doesnt work
My problem, HOW TO MAKE THE FIND BTN WORK...?
 
Old January 5th, 2005, 09:11 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

As Vadivel said froms can not be nested, yours seem to be.

Addtionaly are you aware the name and id are different:
;;;<input type="submit" name="Submit2" id="Submit3" value="Find">


Wind is your friend
Matt
 
Old January 6th, 2005, 02:48 AM
Authorized User
 
Join Date: Nov 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to vanjamier Send a message via AIM to vanjamier Send a message via MSN to vanjamier Send a message via Yahoo to vanjamier
Default

thanks for the tip, i'll have to re - arrange my codes then
 
Old January 6th, 2005, 06:39 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

vanjamier

IMO you should do as Vadivel said:
"we can have multiple submit buttons within a "single" form tag itself."

rather than multiple forms

Wind is your friend
Matt
 
Old January 7th, 2005, 05:21 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hi,
please close first form tag and start secound form
<form name=form1>
contens
</form>
<form name=form2>
contens
</form>

surendran
(Anything is Possible)
 
Old January 27th, 2005, 03:11 PM
Authorized User
 
Join Date: Jan 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is your problem solved???
If no paste your latest code and tell the requirement and
else
just marked the post as solved as it helps the forum.

 
Old January 27th, 2005, 06:17 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;just marked the post as solved

You can do this????

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
php tags in form visible Dj Kat Beginning PHP 4 November 10th, 2006 08:22 AM
bookmarks in QStrings or form action tags mat41 Classic ASP Professional 0 August 26th, 2006 01:02 AM
Problem with IE's innerHTML and <form> tags??!?! nebulus Javascript 1 February 15th, 2006 05:08 PM
UserControls and multiple form tags shenku C# 0 October 14th, 2005 09:08 AM
ShowCategories.aspx form tags developerz BOOK: ASP.NET Website Programming Problem-Design-Solution 0 July 25th, 2003 05:40 AM





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