Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Problem with self-populating form...

    First off, let me apologize if this is the wrong forum. I left the industry in 1996 and just got dragged into it by my department. Although C#, .NET, and JavaScript are being used on this project as well, I think my problem is HTML related.

    Briefly, my problem is this. The form below needs to have the date, person authorizing access, title, department, and contact phone number read-only, but self populating. The information currently seen in this form has been populated with my data. How can I make it so it will populate with other's data? I tried value=, value="", and value=[insert input name data here].

    Our programmer has no idea how to make this work.

    Any ideas or suggestions would be greatly appreciated!

    Code:
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    	<HEAD>
    		<title>MGH Police &amp; Security</title>
    		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
    		<meta content="C#" name="CODE_LANGUAGE">
    		<meta content="JavaScript" name="vs_defaultClientScript">
    		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    		<LINK href="mghCSSlinks.css" type="text/css" rel="stylesheet">
    	</HEAD>
    	<body text="#000000" bgColor="#ffffff">
    		<form name="Form1" method="post" action="access_form.aspx" onsubmit="javascript:return WebForm_OnSubmit();" id="Form1">
    <div>
    <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />
    <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE3MzMwNjI5MTAPZBYCAgEPZBYEAgEPDxYCHgRUZXh0BRRNS0lSV0lOQFBBUlRORVJTLk9SR2RkAgMPDxYCHwAFFDMvMy8yMDEyIDExOjUyOjA3IEFNZGRkOp2rxY7w67SjEhaDR29l5mP7Gdo=" />
    </div>
    
    <script type="text/javascript">
    //<![CDATA[
    var theForm = document.forms['Form1'];
    if (!theForm) {
        theForm = document.Form1;
    }
    function __doPostBack(eventTarget, eventArgument) {
        if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
            theForm.__EVENTTARGET.value = eventTarget;
            theForm.__EVENTARGUMENT.value = eventArgument;
            theForm.submit();
        }
    }
    //]]>
    </script>
    
    
    <script src="/police/WebResource.axd?d=1YlkG3gLHn8vqhEirNoJKNrBlXXexRncYSJEavRiZGsWfsCx1uo4UVyl3kTwCJ4N8NGsDmboCQn84fqU9mXURbpNQZA1&amp;t=634605330834856163" type="text/javascript"></script>
    
    
    <script src="/police/WebResource.axd?d=az-ZJgBVqkHaOt8gSJsWK3YPk6-jhVadgtRUYzdKeh_o-_MXEU_L9KHyLuyqjh7hHVDIeRIMtWmHcD0nnPMcaxOwwkY1&amp;t=634605330834856163" type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[
    function WebForm_OnSubmit() {
    if (typeof(ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) return false;
    return true;
    }
    //]]>
    </script>
    
    <div>
    
    	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWFgL7yIqHBALEhKiDDgKdlcWpAgK5h62pDwLomKbhCAK14pzMDwKVmoXwBAKSwPriCAKY4ZyeAgKZzsPzCQK7+7+DDgLwkKzTBgKw4pyQBQKS/4K8CgKJpanWBgLJ15mVBQLryoe5CgLG5bX4CgLG5rTACgK119zlCgL/x7GMAwLCi9reA/M33ObQatLN31MW6FM9Srmx+YIB" />
    </div>
    			<script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_reloadPage(init) {  //reloads the window if Nav4 resized
      if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
        document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
      else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
    }
    MM_reloadPage(true);
    //-->
    			</script>
    			
    <!-- <div id="Layer2" style="Z-INDEX: 2; LEFT: 15px; WIDTH: 150px; POSITION: absolute; TOP: 24px; HEIGHT: 313px">
    <table cellSpacing="1" cellPadding="4" width="150" background="images/police_table-BG.jpg"
    					border="0">
    					<tr>
    						<td><a class="AAA" href="http://www.massgeneral.org/police/police_directory.htm">Home</a></td>
    					</tr>
    					<tr>
    						<td height="680">&nbsp;</td>
    					</tr>
    				</table>
    			</div>
     -->
    <!-- New by ChungKim -->
    <div id="Layer1" style="position:absolute; left:1px; top:1px; width:784px; height:65px; z-index:1;">
    <table rows="1" cols="2" width="784" height="65" border="0" cellspacing="0" cellpadding="0">
    <tr>
          <td width="200"> <a href="http://www2.massgeneral.org"><img src="http://www2.massgeneral.org/navbar/nav_security01.jpg" width="200" height="65" border="0" alt="Mass General Home"></a> 
          </td>
          <td width="584"> <img src="http://www2.massgeneral.org/navbar/nav_security02.jpg" width="584" height="65"> 
          </td>
    </tr>
    </table>
    </div>
    
    			<div id="Layer3" style="Z-INDEX: 3; LEFT: 172px; WIDTH: 600px; POSITION: absolute; TOP: 24px; HEIGHT: 155px">
      <table cellSpacing="0" cellPadding="4" width="600" align="center" border="0">
    
    
      <tr>
          <td width="200"><BR><BR><BR> 
          </td>
          <td width="584"> &nbsp;<BR><BR><BR> 
          </td>
    </tr>
    
    					<tr>
    						<td width="600" colSpan="4"><b>Request for Access to MGH Main Campus or CNY/Satellite 
    								Facilities</b>
    							<br>
    							Requests for Access will be fulfilled if the person submitting this form is 
    							listed with MGH Police &amp; Security<br>
    							as authorized to grant access for the area.
    							<br>
    							<br>
    							
    						</td>
    					</tr>
    					<tr>
    						<td vAlign="middle" align="right" width="120">Date (MM/DD/YYYY):</td>
    						<td vAlign="top" width="180"><input name="txtDate" type="text" value="3/3/2012 11:52:07 AM" readonly="readonly" id="txtDate" class="textbox" style="width:150px;" /></td>
    						<td vAlign="middle" align="right" width="120">&nbsp;</td>
    						<td vAlign="top" width="180">&nbsp;</td>
    					</tr>
    					<tr>
    						<td vAlign="middle" align="right">Last Name:</td>
    						<td vAlign="top"><br>
    						  <input name="txtLastName" type="text" id="txtLastName" class="textbox" style="width:150px;" />
    						  
    						  <span id="rfvLastName" style="color:Red;visibility:hidden;"><br />* Please enter Last Name</span>
    						</td>
    						<td vAlign="middle" align="right">First Name:</td>
    						<td vAlign="top"><br>
    						  <input name="txtFirstName" type="text" id="txtFirstName" class="textbox" />
    						  
    						  <span id="rfvFirstName" style="color:Red;visibility:hidden;"><br />* Please enter First Name</span>
    						</td>
    					</tr>
    					<tr>
    						<td vAlign="middle" align="right">Peoplesoft #:</td>
    						<td vAlign="top"><br><br>
    						  <input name="txtPeoplesoft" type="text" id="txtPeoplesoft" class="textbox" style="width:150px;" />
    						  <br />
    						  <span id="rfvPeoplesoft" style="color:Red;visibility:hidden;"><br />* Please enter employee PeopleSoft ID</span>
    						</td>
    						<td vAlign="middle" align="right">Department:</td>
    						<td vAlign="top"><br><br>
    						  <input name="txtDepartment" type="text" id="txtDepartment" class="textbox" />
              	</td>
    					</tr>
    					<tr>
    						<td vAlign="top" colSpan="4">Access Request Location:&nbsp;<table id="rblLocation" border="0" style="font-weight:bold;">
    	<tr>
    		<td><input id="rblLocation_0" type="radio" name="rblLocation" value="MGHPhotoIDMainCampus@partners.org" /><label for="rblLocation_0">
    									<b>Main Campus</b></label></td><td><input id="rblLocation_1" type="radio" name="rblLocation" value="MGHPhotoIDCampusSatellites@partners.org" /><label for="rblLocation_1">
    									<b>CNY/Satellites</b></label></td>
    	</tr>
    </table>
    							<span id="rfvLoc" style="color:Red;visibility:hidden;">* Location is Required</span></td>
    					</tr>
    					<tr>
    						<td colSpan="4">List Buildings, Departments, Restriced area(s) or specific floors 
    							where access is required below:</td>
    					</tr>
    					<tr>
    						<td colSpan="4"><textarea name="txtLocationList" rows="5" cols="105" id="txtLocationList" class="textbox"></textarea></td>
    					</tr>
    					<tr>
    						<td colSpan="4">List High Risk areas below:</td>
    					</tr>
    					<tr>
    						<td colSpan="4"><textarea name="txtHighRisk" rows="5" cols="105" id="txtHighRisk" class="textbox"></textarea></td>
    					</tr>
    					<!-- <tr>
    						<td vAlign="middle" align="right">10th Data Center:</td>
    						<td vAlign="top"><table id="rblTenthData" border="0">
    	<tr>
    		<td><input id="rblTenthData_0" type="radio" name="rblTenthData" value="No" checked="checked" /><label for="rblTenthData_0">No</label></td><td><input id="rblTenthData_1" type="radio" name="rblTenthData" value="Yes" /><label for="rblTenthData_1">Yes</label></td>
    	</tr>
    </table></td>
    						<td vAlign="middle" align="right">OCC Finance/IS:</td>
    						<td vAlign="top"><table id="rblOccfinance" border="0">
    	<tr>
    		<td><input id="rblOccfinance_0" type="radio" name="rblOccfinance" value="No" checked="checked" /><label for="rblOccfinance_0">No</label></td><td><input id="rblOccfinance_1" type="radio" name="rblOccfinance" value="Yes" /><label for="rblOccfinance_1">Yes</label></td>
    	</tr>
    </table></td>
    					</tr> -->
    					<tr>
    						<td vAlign="middle" align="right">Person Authorizing Access:</td>
    						<td vAlign="middle"><BR><BR>
    						  <input name="txtPersonauthorizingname" type="text" value="Matthew Kirwin" readonly="readonly" id="txtPersonauthorizingname" class="textbox" style="width:150px;" />
    						  <br />
    						  <span id="rfvPAName" style="color:Red;visibility:hidden;">* Authorizing Person is Required</span>
    						</td>
    						<td vAlign="middle" align="right">Title:</td>
    						<td vAlign="middle"><br><br>
    						  <input name="txtPersonauthorizingtitle" type="text" value="Night Shift, Main Campus" readonly="readonly" id="txtPersonauthorizingtitle" class="textbox" style="width:150px;" />
    						  <br />
    						  <span id="rfvPATitle" style="color:Red;visibility:hidden;">* Authorizing Person Title is Required</span>
    						</td>
    					</tr>
    					<tr>
    						<td vAlign="middle" align="right">Department:</td>
    						<td vAlign="middle"><BR><BR>
    						  <input name="txtPersonauthorizingdept" type="text" value="Police and Security" readonly="readonly" id="txtPersonauthorizingdept" class="textbox" style="width:150px;" />
                  <br />
    						  <span id="rfvPADept" style="color:Red;visibility:hidden;">* Authorizing Person Department is Required</span>
    						</td>
    						<td vAlign="middle" align="right">Contact Phone #:</td>
    						<td vAlign="middle"><BR><BR>
    						  <input name="txtPersonauthorizingphone" type="text" value="617-726-2124" readonly="readonly" id="txtPersonauthorizingphone" class="textbox" style="width:150px;" />
                  <br />
    						  <span id="rfvPAPhone" style="color:Red;visibility:hidden;">* Authorizing Person Phone is Required</span>						
    						</td>
    					</tr>
    					<tr>
    						<td colSpan="4"><br>
    							Any questions regarding access programming should be directed to the photo ID 
    							office.<br>
    							For questions please contact:</td>
    					</tr>
    					<tr>
    						<td vAlign="top" colSpan="2">Main Campus ID Office<br>
    Wang Building<br>
    Second Floor, Suite 232<br>
    Telephone: 617-724-3916</td>
    						<td vAlign="top" colSpan="2">CNY/Satellites ID Office
    							<br>
    							CNY 149 13th Street
    							<br>
    							First Floor West Lobby
    							<br>
    							Telephone: 617-724-3031
    						</td>
    					</tr>
    					<tr>
    						<td colSpan="4"><br>
    							<input type="submit" name="btnSubmit" value="Submit Form" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnSubmit&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="btnSubmit" class="button" /><br>
    							<br>
    							<br>
    						</td>
    					</tr>
    				</table>
    			</div>
    		  <p>&nbsp;</p>
    			<p>&nbsp;</p>
    			<p>&nbsp;</p>
    			<p>&nbsp;</p>
    		
    <script type="text/javascript">
    //<![CDATA[
    var Page_Validators =  new Array(document.getElementById("rfvLastName"), document.getElementById("rfvFirstName"), document.getElementById("rfvPeoplesoft"), document.getElementById("rfvLoc"), document.getElementById("rfvPAName"), document.getElementById("rfvPATitle"), document.getElementById("rfvPADept"), document.getElementById("rfvPAPhone"));
    //]]>
    </script>
    
    <script type="text/javascript">
    //<![CDATA[
    var rfvLastName = document.all ? document.all["rfvLastName"] : document.getElementById("rfvLastName");
    rfvLastName.controltovalidate = "txtLastName";
    rfvLastName.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    rfvLastName.initialvalue = "";
    var rfvFirstName = document.all ? document.all["rfvFirstName"] : document.getElementById("rfvFirstName");
    rfvFirstName.controltovalidate = "txtFirstName";
    rfvFirstName.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    rfvFirstName.initialvalue = "";
    var rfvPeoplesoft = document.all ? document.all["rfvPeoplesoft"] : document.getElementById("rfvPeoplesoft");
    rfvPeoplesoft.controltovalidate = "txtPeoplesoft";
    rfvPeoplesoft.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    rfvPeoplesoft.initialvalue = "";
    var rfvLoc = document.all ? document.all["rfvLoc"] : document.getElementById("rfvLoc");
    rfvLoc.controltovalidate = "rblLocation";
    rfvLoc.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    rfvLoc.initialvalue = "";
    var rfvPAName = document.all ? document.all["rfvPAName"] : document.getElementById("rfvPAName");
    rfvPAName.controltovalidate = "txtPersonauthorizingname";
    rfvPAName.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    rfvPAName.initialvalue = "";
    var rfvPATitle = document.all ? document.all["rfvPATitle"] : document.getElementById("rfvPATitle");
    rfvPATitle.controltovalidate = "txtPersonauthorizingtitle";
    rfvPATitle.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    rfvPATitle.initialvalue = "";
    var rfvPADept = document.all ? document.all["rfvPADept"] : document.getElementById("rfvPADept");
    rfvPADept.controltovalidate = "txtPersonauthorizingdept";
    rfvPADept.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    rfvPADept.initialvalue = "";
    var rfvPAPhone = document.all ? document.all["rfvPAPhone"] : document.getElementById("rfvPAPhone");
    rfvPAPhone.controltovalidate = "txtPersonauthorizingphone";
    rfvPAPhone.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
    rfvPAPhone.initialvalue = "";
    //]]>
    </script>
    
    
    <script type="text/javascript">
    //<![CDATA[
    
    var Page_ValidationActive = false;
    if (typeof(ValidatorOnLoad) == "function") {
        ValidatorOnLoad();
    }
    
    function ValidatorOnSubmit() {
        if (Page_ValidationActive) {
            return ValidatorCommonOnSubmit();
        }
        else {
            return true;
        }
    }
            //]]>
    </script>
    </form>
    	</body>
    </HTML>

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    Quote Originally Posted by sw40c View Post
    First off, let me apologize if this is the wrong forum. I left the industry in 1996 and just got dragged into it by my department. Although C#, .NET, and JavaScript are being used on this project as well, I think my problem is HTML related.

    Briefly, my problem is this. The form below needs to have the date, person authorizing access, title, department, and contact phone number read-only, but self populating. The information currently seen in this form has been populated with my data. How can I make it so it will populate with other's data? I tried value=, value="", and value=[insert input name data here].

    Our programmer has no idea how to make this work.

    Any ideas or suggestions would be greatly appreciated!

    Code:
    <!-- snip -->
        <tr>
          <td vAlign="middle" align="right">Person Authorizing Access:</td>
          <td vAlign="middle"><br /><br />
            <input name="txtPersonauthorizingname" type="text" value="Matthew Kirwin" readonly="readonly" id="txtPersonauthorizingname" class="textbox" style="width:150px;" />
            <br />
            <span id="rfvPAName" style="color:Red;visibility:hidden;">* Authorizing Person is Required</span>
          </td>
          <td vAlign="middle" align="right">Title:</td>
          <td vAlign="middle"><br /><br />
            <input name="txtPersonauthorizingtitle" type="text" value="Night Shift, Main Campus" readonly="readonly" id="txtPersonauthorizingtitle" class="textbox" style="width:150px;" />
            <br />
            <span id="rfvPATitle" style="color:Red;visibility:hidden;">* Authorizing Person Title is Required</span>
          </td>
        </tr>
        <tr>
          <td vAlign="middle" align="right">Department:</td>
          <td vAlign="middle"><br /><br />
            <input name="txtPersonauthorizingdept" type="text" value="Police and Security" readonly="readonly" id="txtPersonauthorizingdept" class="textbox" style="width:150px;" />
            <br />
            <span id="rfvPADept" style="color:Red;visibility:hidden;">* Authorizing Person Department is Required</span>
          </td>
          <td vAlign="middle" align="right">Contact Phone #:</td>
          <td vAlign="middle"><br /><br />
            <input name="txtPersonauthorizingphone" type="text" value="617-726-2124" readonly="readonly" id="txtPersonauthorizingphone" class="textbox" style="width:150px;" />
            <br />
            <span id="rfvPAPhone" style="color:Red;visibility:hidden;">* Authorizing Person Phone is Required</span>      
          </td>
        </tr>
    <!-- /snip -->
    I pared your code down to the relevant HTML section in your quoted text above...

    How do we know who is filling out the form? In other words, how do we know whose information should be auto-populated into the relevant inputs? This is almost certainly going to be something that is done server-side based on session data.

    Let me know about the above and we can find the correct path...
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •