Hiding / showing page parts based on form changes using rel attribute

When I submit the form, I gets NULL value for "LibShortDesc" & "LibLongDesc" even though some text in it. It works in the IE but not in Firefox. Please help. Thanks.

<form name="submit" action="formsubmit.asp">
	<table border="0">
	<tr>
		<td>
		 <input type="checkbox" name="itemaddPL" id="itemaddPL" value="Y" rel="itemaddPLview"/
		 <span class="formbuttons-blue">&nbsp;&nbsp;Add To My Library&nbsp;&nbsp;</span>
        </td>
	</tr>
	<tr rel="itemaddPLview">
        <td>
			<table border="0" width="100%" cellpadding="1" cellspacing="2" style="border:1px black solid;">					
				<tr><td valign="top"><b>Short Desc:</b></td>
				<td> <input type="text" name="LibShortDesc" size="40" class="forminput-field"></td>
				</tr>
				<tr><td valign="top"><b>Long Desc:</b></td>
				<td> <textarea name="LibLongDesc" rows="3" cols="30" class="forminput-field"></textarea></td>
				</tr>				
			</table>
		</td>
	</tr>
	</table>
</form>

Open in new window

andrishelpAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
hieloConnect With a Mentor Commented:
save this as test.asp and try it:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<%
If "SUBMIT"=Request.Form("Submit") Then
	Response.Write( "<div>Short: " & Request.Form("LibShortDesc") & "</div>")
	Response.Write( "<div>Long: " & Request.Form("LibLongDesc") & "</div>")
End If
%>
<form name="submitForm" action="<%=Request.ServerVariables("SCRIPT_NAME")%>" method="post">
	<table border="0">
	<tr>
		<td>
		 <input type="checkbox" name="itemaddPL" id="itemaddPL" value="Y" rel="itemaddPLview"/>
		 <span class="formbuttons-blue">&nbsp;&nbsp;Add To My Library&nbsp;&nbsp;</span>
        </td>
	</tr>
	<tr rel="itemaddPLview">
        <td>
			<table border="0" width="100%" cellpadding="1" cellspacing="2" style="border:1px black solid;">					
				<tr><td valign="top"><b>Short Desc:</b></td>
				<td> <input type="text" name="LibShortDesc" size="40" class="forminput-field" /></td>
				</tr>
				<tr><td valign="top"><b>Long Desc:</b></td>
				<td> <textarea name="LibLongDesc" rows="3" cols="30" class="forminput-field" /></textarea></td>
				</tr>				
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<input type="submit" name="Submit" Value="SUBMIT">
		</td>
	</tr>
	</table>
</form>
</body>
</html>

Open in new window

0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
you need to add the form method:

<form name="submit" action="formsubmit.asp" method="post">
0
 
andrishelpAuthor Commented:
Sorry, I forgot to add that in the sample code. But I do have that in main program.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
hieloCommented:
your checkbox lacks a > at the end:
<input type="checkbox" name="itemaddPL" id="itemaddPL" value="Y" rel="itemaddPLview"/>

Also, how are you submitting the form? I don't see a submit button.
0
 
andrishelpAuthor Commented:

<form name="submit" action="formsubmit.asp" method="post">
	<table border="0">
	<tr>
		<td>
		 <input type="checkbox" name="itemaddPL" id="itemaddPL" value="Y" rel="itemaddPLview"/>
		 <span class="formbuttons-blue">&nbsp;&nbsp;Add To My Library&nbsp;&nbsp;</span>
        </td>
	</tr>
	<tr rel="itemaddPLview">
        <td>
			<table border="0" width="100%" cellpadding="1" cellspacing="2" style="border:1px black solid;">					
				<tr><td valign="top"><b>Short Desc:</b></td>
				<td> <input type="text" name="LibShortDesc" size="40" class="forminput-field"></td>
				</tr>
				<tr><td valign="top"><b>Long Desc:</b></td>
				<td> <textarea name="LibLongDesc" rows="3" cols="30" class="forminput-field"></textarea></td>
				</tr>				
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<input type="submit" name="submit" Value="SUBMIT">
		</td>
	</tr>
	</table>
</form>

Open in new window

0
 
andrishelpAuthor Commented:
When I submit the form, I gets NULL value for "LibShortDesc" & "LibLongDesc" even though some text in it. It works in the IE but not in Firefox.
0
 
hieloCommented:
Did you copy and paste MY example EXACTLY as given, or did you try YOUR own code?
What version of Firefox? What OS?
0
 
andrishelpAuthor Commented:
I copied your example and it worked. But I am applying to my code, it did not work. Also, the "Add to my library" is clickable option which hide or show "short Desc" & "long desc" textbox. Which is not working in your code.

<tr>
<td>
 <input type="checkbox" name="itemaddPL" id="itemaddPL" value="Y" rel="itemaddPLview"/>
 <span class="formbuttons-blue">&nbsp;&nbsp;Add To My Library&nbsp;&nbsp;</span>
</td>
</tr>
<tr rel="itemaddPLview">

0
 
hieloCommented:
Then you need to post your existing code. Clearly the problem is within the code that you did NOT post, not on what you posted.
0
 
andrishelpAuthor Commented:
The file is too large (more than 5000 lines of code and also linked to other files.) Anyhow, I will review it again and if I can't find the work around, I will send whole file. Thanks for your help.
0
All Courses

From novice to tech pro — start learning today.