Link to home
Start Free TrialLog in
Avatar of Malloy1446
Malloy1446

asked on

Extra commas generated when displaying results from form

I have a form with an option for the user to select three options. Based on the option selected, user fills out option specific fields. There are also two fields which are available in all three options (ILLNotNeeded and ILLInfo). Code then submits the data to the database and displays a confirmation page with all data. The issue I am having is for these two fields it it displaying extra commas.

Following is the code for the request form.
<style>
	.chooseJournal,.chooseBook,.chooseAudiovisual{display:none;}
</style>

<script src="//code.jquery.com/jquery-1.11.1.min.js">
</script>

<script>

	$(function()
		{
		$('#btnSubmit').hide();
		$('#btnClear').hide();
		$(" input[name='ILLRequestType']").click(function()
		
		{
		var type=$(this).val();
		
			if(type==="Journal Article"){
				$('.chooseJournal').show();
				$('.chooseBook').hide();
 				$('.chooseAudiovisual').hide();
 				$('#btnSubmit').show();
 				$('#btnClear').show();
      
    		}
    		if(type==="Book"){
       			$('.chooseJournal').hide();
      			$('.chooseBook').show();
 				$('.chooseAudiovisual').hide();
 				$('#btnSubmit').show();
 				$('#btnClear').show();

    		}
    		if(type==="Audiovisual"){
       			$('.chooseJournal').hide();
      			$('.chooseBook').hide();
 				$('.chooseAudiovisual').show();
 				$('#btnSubmit').show();
 				$('#btnClear').show();
    		}
    
})
  
})

</script>



<!-------------------------------------------------------------------------------------------->
<!------------------------------------ Continue the code ------------------------------------->
<title><%=title%></title>

<body>

<div id="CenterTwo">

<h2><%=title%></h2>  

<b>Location: VISN <%=session("VISNID")%> -- <%=session("FacName")%> (<%=session("City")%>, <%=session("State")%>)</b>



<!-------------------------------------------------------------------------------------------->
<!---------------------------- Information related to Eligibility ---------------------------->

<p>It is simple to request a book, audiovisual or an article from a journal. Complete the 
personal information, select the type of request, complete the fields as displayed and then 
click the submit button. Request will be forwarded to library staff for 
processing. If you have questions, contact your local library staff.
<br>


<%
'response.Write("chartID: " & session("ChartID"))
'response.End()
%>

<hr>



<form method="POST" action="Eligible2.asp" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1" language="JavaScript">



<!-------------------------------------------------------------------------------------------->
<!----------------------------- REQUESTOR'S PERSONAL INFORMATION ----------------------------->

<p><b>First Name:&nbsp; </b>
<!--webbot bot="Validation" s-display-name="First_Name" b-value-required="TRUE" i-minimum-length="3" i-maximum-length="250" -->
<input name="ILLRequestorsFName" type="text" size="100" maxlength="250" value="<%=Request("ILLRequestorsFName")%>"></p>
  
<p><b>Last Name:&nbsp; </b>
<!--webbot bot="Validation" s-display-name="Last_Name" b-value-required="TRUE" i-minimum-length="3" i-maximum-length="255" -->
<input name="ILLRequestorsLName" type="text" size="100" maxlength="255" value="<%=Request("ILLRequestorsLName")%>"></p>
  
<p><b>Service:&nbsp;</b>
<input name="ILLRequestorsService" type="text" size="75" value="<%=Request("ILLRequestorsService")%>"></p>

<p><b>Email:&nbsp;</b>
<!--webbot bot="Validation" s-display-name="Email" b-value-required="TRUE" i-minimum-length="5" -->
<input name="ILLRequestorsEmail" type="text" size="75" value="<%=Request("ILLRequestorsEmail")%>"></p>

<p><b>Phone Number:&nbsp;</b>
<input name="ILLRequestorsPhone" type="text" size="75" value="<%=Request("ILLRequestorsPhone")%>"></p>



<!-------------------------------------------------------------------------------------------->
<!------------------------------------- TYPE OF REQUEST -------------------------------------->
<!-------------------- BASED ON RESPONSE, APPROPRIATE FORM WILL DISPLAY ---------------------->
<p><b>Type of Request:&nbsp;</b>

<blockquote>
	<input type="radio" name="ILLRequestType" value="Journal Article">Journal Article<br>
	<input type="radio" name="ILLRequestType" value="Book">Book/Book Chapter<br>
	<input type="radio" name="ILLRequestType" value="Audiovisual">Audiovisual (Audiocassette, DVD, etc)
</blockquote>
<hr>
Please submit as much information as possible and use the additional information field as 
needed. Incomplete information will delay filling your requests.



<!------------------------------------------------------------------------------------------->
<!------------------------------------- BOOK REQUEST ---------------------------------------->
<!-------------------- IF BOOK SELECTED, FOLLOWING DATA IS COLLECTED ------------------------>
<div class="chooseBook">
<hr>

	<p><b>Author or Editor:&nbsp; </b>
	<input type="text" name="ILLBookAuthor" size="100"></p>
  
	<p><b>Title:&nbsp; </b>
	<input type="text" name="ILLBookTitle" size="100"></p>
  
	<p><b>ISBN:&nbsp; </b>
	<input type="text" name="ILLBookISBN" size="25"></p>

	<p><b>Chapter Title (optional):&nbsp; </b>
	<input type="text" name="ILLBookChapter" size="100"></p>

	<p><b>Chapter Pages (optional):&nbsp; </b>
	<input type="text" name="ILLBookChapterPages" size="25"></p>

	<p><b>Publisher:&nbsp; </b>
	<input type="text" name="ILLBookPublisher" size="100"></p>

	<p><b>Year of Publication (YYYY):&nbsp; </b>
	<input type="text" name="ILLBookPubYear" size="10">

	&nbsp;&nbsp;&nbsp;&nbsp;<b>Edition:&nbsp; </b>
	<input type="text" name="ILLBookEd" size="15"></p>
	
	<p><b>Not Needed After:&nbsp; </b>
	<input type="text" name="ILLNotNeeded" size="100"></p>
	
	<p><b>Additional Info:&nbsp; </b>
	<input type="text" name="ILLInfo" size="100"></p>
	

<!---------------------------------------- Copyright ---------------------------------------->

<hr>
<div class="style1">
	<strong>Warning Concerning Copyright Restrictions </strong>
</div>

<p>
The copyright law of the United States (Title 17, United States Code) governs the 
making of photocopies or other reproductions of copyright material. Under certain 
conditions specified in the law, libraries and archives are authorized to furnish 
a photocopy or other reproduction. One of these specified conditions is that the 
photocopy or reproduction is not to be "for any purpose other than private study, 
scholarship, or research". If a user makes a request for, or later uses, a 
photocopy or reproduction for purposes in excess of "fair use", that user may be 
liable for copyright infringement. This institution reserves the right to refuse 
a copying order if, in its judgment, fulfillment of the order would involve 
violation of copyright law.

</div>



<!------------------------------------------------------------------------------------------->
<!--------------------------- JOURNAL ARTICLE REQUEST --------------------------------------->
<!--------------- IF JOURNAL ARTICLE IS SELECTED, FOLLOWING DATA IS COLLECTED --------------->
<div class="chooseJournal">
<hr>
	<p><b>Journal Title:&nbsp; </b>
	<input type="text" name="ILLJournalTitle" size="100"></p>
  
	<p><b>ISSN:&nbsp; </b>
	<input type="text" name="ILLJournalISSN" size="20"></p>
  
	<p><b>Volume:&nbsp; </b>
	<input type="text" name="ILLJournalVolume" size="15">
  
	&nbsp;&nbsp;&nbsp;&nbsp;<b>Issue:&nbsp; </b>
	<input type="text" name="ILLJournalIssue" size="15">
  
	&nbsp;&nbsp;&nbsp;&nbsp;<b>Publication Date:&nbsp; </b>
	<input type="text" name="ILLJournalPubDate" size="20"></p>
  
	<p><b>PMID/PubMed Identifier:&nbsp; </b>
	<input type="text" name="ILLJournalPMID" size="25"></p>
  
	<p><b>ArticleTitle:&nbsp; </b>
	<input type="text" name="ILLJournalArticle" size="100"></p>

	<p>&nbsp;&nbsp;&nbsp;&nbsp;<b>Author:&nbsp; </b>
	<input type="text" name="ILLJournalArticleAuthor" size="100"></p>
  
	<p>&nbsp;&nbsp;&nbsp;&nbsp;<b>Page Range:&nbsp; </b>
	<input type="text" name="ILLJournalPages" size="20"></p>
	
	<p><b>Not Needed After:&nbsp; </b>
	<input type="text" name="ILLNotNeeded" size="100"></p>
 
	<p><b>Additional Info:&nbsp; </b>
	<input type="text" name="ILLInfo" size="100"></p>
	




<!---------------------------------------- Copyright ---------------------------------------->

<hr>
<div class="style1">
	<strong>Warning Concerning Copyright Restrictions </strong>
</div>

<p>
The copyright law of the United States (Title 17, United States Code) governs the 
making of photocopies or other reproductions of copyright material. Under certain 
conditions specified in the law, libraries and archives are authorized to furnish 
a photocopy or other reproduction. One of these specified conditions is that the 
photocopy or reproduction is not to be "for any purpose other than private study, 
scholarship, or research". If a user makes a request for, or later uses, a 
photocopy or reproduction for purposes in excess of "fair use", that user may be 
liable for copyright infringement. This institution reserves the right to refuse 
a copying order if, in its judgment, fulfillment of the order would involve 
violation of copyright law.

</div>



<!-------------------------------------------------------------------------------------->
<!------------------------------------ AV REQUEST -----==------------------------------->
<!------------ IF AUDIOVISUAL IS SELECTED, FOLLOWING DATA IS COLLECTED ----------------->
<div class="chooseAudiovisual">
<hr>
	<p><b>Audiovisual Title:&nbsp; </b>
	<input type="text" name="ILLAVTitle" size="100"></p>
  
	<p><b>Audiovisual Producer:&nbsp; </b>
	<input type="text" name="ILLAVProducer" size="100"></p>

	<p><b>Production Year:&nbsp; </b>
	<input type="text" name="ILLAVProductionYear" size="100"></p>

	<p><b>Not Needed After:&nbsp; </b>
	<input type="text" name="ILLNotNeeded" size="100"></p>

	<p><b>Additional Info:&nbsp; </b>
	<input type="text" name="ILLInfo" size="100"></p>
	

	
<!---------------------------------------- Copyright ---------------------------------------->

<hr>
<div class="style1">
	<strong>Warning Concerning Copyright Restrictions </strong>
</div>

<p>
The copyright law of the United States (Title 17, United States Code) governs the 
making of photocopies or other reproductions of copyright material. Under certain 
conditions specified in the law, libraries and archives are authorized to furnish 
a photocopy or other reproduction. One of these specified conditions is that the 
photocopy or reproduction is not to be "for any purpose other than private study, 
scholarship, or research". If a user makes a request for, or later uses, a 
photocopy or reproduction for purposes in excess of "fair use", that user may be 
liable for copyright infringement. This institution reserves the right to refuse 
a copying order if, in its judgment, fulfillment of the order would involve 
violation of copyright law.

</div>





<!------------------------------------ TIME TO SUBMIT ------------------------------------>

<hr>
<input type="hidden" name="ILLSubmitDate" value="<%=Date()%>">
<input type="hidden" name="ChartID" value="<%=session("ChartID")%>">
<input id="btnSubmit" type="submit" value="Submit Request">
<input id="btnClear" type="reset" value="Clear">

Open in new window


Following is the code displaying the results on the submit page:
txtBody = "Requestor's Name: " & request.form("ILLRequestorsFName") & " " & request.form("ILLRequestorsLName")
txtBody = txtBody & "<br>Service: " & request.form("ILLRequestorsService")
txtBody = txtBody & "<br>Email: " & request.form("ILLRequestorsEmail")
txtBody = txtBody & "<br>Phone: " & request.form("ILLRequestorsPhone")

	txtBody = txtBody & "<p>&nbsp;&nbsp;Type of Request: " & request.form("ILLRequestType")

	IF request.form("ILLRequestType") = "Book" THEN
		txtBody = txtBody & "<p>&nbsp;&nbsp;Book Author: " & request.form("ILLBookAuthor")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Book Title: " & request.form("ILLBookTitle")
		txtBody = txtBody & "<br>&nbsp;&nbsp;ISBN: " & request.form("ILLBookISBN")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Book Chapter: " & request.form("ILLBookChapter")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Book Chapter Pages: " & request.form("ILLBookChapterPages")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Publisher: " & request.form("ILLBookPublisher")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Publication Date: " & request.form("ILLBookPubYear")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Edition: " & request.form("ILLBookEd")
	END IF
	
	IF request.form("ILLRequestType") = "Audiovisual" THEN
		txtBody = txtBody & "<p>&nbsp;&nbsp;Audiovisual Title: " & request.form("ILLAVTitle")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Producer: " & request.form("ILLAVProducer")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Production Year: " & request.form("ILLAVProductionYear")
	END IF
	
	IF request.form("ILLRequestType") = "Journal Article" THEN
		txtBody = txtBody & "<p>&nbsp;&nbsp;Journal Title: " & request.form("ILLJournalTitle")
		txtBody = txtBody & "<br>&nbsp;&nbsp;ISSN: " & request.form("ILLJournalISSN")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Volume: " & request.form("ILLJournalVolume")
		txtBody = txtBody & "&nbsp;&nbsp;Issue: " & request.form("ILLJournalIssue") 
		txtBody = txtBody & "&nbsp;&nbsp;Publication Date: " & request.form("ILLJournalPubDate") 
		txtBody = txtBody & "<br>&nbsp;&nbsp;PMID: " & request.form("ILLJournalPMID")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Journal Article: " & request.form("ILLJournalArticle")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Author: " & request.form("ILLJournalArticleAuthor")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Page range: " & request.form("ILLJournalPages")
	END IF

		txtBody = txtBody & "<br>&nbsp;&nbsp;Not needed after: " & request.form("ILLNotNeeded")
		txtBody = txtBody & "<br>&nbsp;&nbsp;Additional Info: " & request.form("ILLInfo")

Open in new window


Screen display is also included and as you will see the two fields (ILLNotNeeded and ILLInfo) have two commas which are not needed. How can I eliminate them?
Display.png
ASKER CERTIFIED SOLUTION
Avatar of mankowitz
mankowitz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Malloy1446
Malloy1446

ASKER

I knew that would be one solution, I just was hoping I would not need to create 4 additional fields.