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 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up In javascript is there a go to feature

    In java script is there a method in which you can jump to a particular line or jump to a specific point in the code .

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    No. This is the reson the functions were made for. The possible "subroutines" are nested in isolate functions. You may call or not those functions from another functions, upon needs.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You may jump over a certain part of the code (using conditionals), you may stop the code, you may repeat a part of the code (loops, setTimeout()...), but you may not jump to a certain line. javascript does not care about the code line number.

    Why do you need that? Which is your problem? maybe we could help.
    Last edited by Kor; 07-28-2006 at 04:08 PM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #4
    New Coder
    Join Date
    Jun 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a problem I stated i yesterday but to no help , so I will now provide come . PLease keep in mind that I am also using pl/sql connecting to a oracle database.

    Here is the problem:

    Hello, I'm trying to jump from page to page and have the same information on the page and If the the same page is returned to , by using the back button, the information is shown on the page.If the submit button is pressed again after a user decides to make changes, the information that is on the page gets updated to the database rather than inserted as a new record.The problem that I am having is that the information doesnt get updated, like it is suppose to, the information gets inserted as a new record, which kicks out a new confirmation number, which it isnt suppose to since the information is already in the database.

    Here is the code:

    Code:
    
    
    if p_requestor_id IS NULL THEN 
    		
    		
    		
    	if p_last_name IS NOT NULL AND p_first_name IS NOT NULL THEN
    	
    			INSERT INTO lp_data.lp_data_requests_tbl(FIRSTNAME,LASTNAME,DATA_REQUEST,
    			TARGET_DATE,DATA_SOURCE,OUTPUT_COLUMNS,
    			REQUEST_DATE,OUTPUT_FORMAT,METHOD_OF_DELIVERY,
    			FTP_USER,FTP_PASSWORD,FTP_HOST,
    			DOMAIN_NAME,DATE_PARAMETERS,INTERNAL_USE_ONLY)
    			VALUES(p_firstname,p_lastname,p_data_request,
    			v_target_date,p_data_source,p_output_columns,
    			sysdate,p_output_format,p_method_of_delivery,
    			p_ftp_user,v_password_raw ,p_ftp_host,
    			p_domain_name,p_date_parameters,substr(nvl(p_internal_use_only,v_internal_use_only),1,1))
    			returning requestor_id INTO v_requestor_id;--used to return current/most recent requestor id
    			COMMIT;
                
    				htp.prn('
    		<font class="BodyDarkBlueLarge"> Confirmation</font>
    		<br><font class="BodyDarkBlueLarge">&nbsp;&nbsp; Information Added</font>
    		<form name="ConfirmationPage" action ="'||g_v_fwcdevi||'fwc_www.lp_intra_pkg.lp_data_request_pr?p_menu_id='||p_menu_id||'&p_requestor_id='||v_requestor_id||'" method="post" >
    		 <table width=768>			
    			    <tr>
    					<td width="2%"></td>
    		       		<td>Request No. : '||v_requestor_id||'</td>
    		   	   </tr>
    		       <tr>
    				   <td width="2%"></td>
    		   		   <td>Date of Submission: '||v_char||'</td>
    			  </tr>
    		      <tr>
    				    <td width="2%"></td>
    					<td> First Name:'||v_firstname||'   </td>
    			 </tr>
    		     <tr>
    				    <td width="2%"></td>
    					<td>Last Name:  '||v_lastname||' </td>
    			</tr>
    		    <tr>
    				    <td width="2%"></td>
    					<td>Email: '||v_domain_name||' @myfwc.com </td>
    		 	</tr>
    		    <tr>
    				    <td width="2%"></td>
    			<td>Would data be used for internal use: '||v_internal_use_only||'</td>
    		     </tr>
    		     <tr>
    				    <td width="2%"></td>
    					<td>Target Date: '||v_char2||'</td>
    		     </tr>
    		     <tr>
    				    <td width="2%"></td>
    					<td>Data Source: '||v_data_source||' </td>
    		   </tr>
    		      <tr>
    				    <td width="2%"></td>
    			  <td>Description of Data Request:  '||v_data_request||' </td>
    		   </tr>
    		       <tr>
    				    <td width="2%"></td>
    		   <td>Fields to Display: '||v_output_columns||'</td>
    			</tr>
    			    <tr>
    				    <td width="2%"></td>
    			<td>Date Parameters:  '||v_date_parameters||'</td>
    			</tr>
    			    <tr>
    				    <td width="2%"></td>
    					<td>Output:'||v_output_format||' </td>
    			 </tr>
    			     <tr>
    				    <td width="2%"></td>
    					<td>Method of Delivery: '||v_method_of_delivery||'</td>
    			     </tr>
    		
    		<tr>
    		<td width="2%"></td>
    				<td><input type="submit" value="Back" alt="Back Button" ></td>
    				</tr>
    		</table>
    		</form>');
    
    
    
    			v_hold_value :='I';
    	
    
    	else
    
    	
    
    		
    		htp.prn('
    
    <form onsubmit="return validateOnSubmit()" name="UpdateDataRequest" action="'||g_v_fwcdevi||'fwc_www.lp_intra_pkg.lp_data_request_pr" method="post" >
    	<input type ="hidden" alt="Hidden Field" name="v_hold_value" value="I">	
    		   <table width=768>	
    	
    			    <tr><td width="2%"></td>
    				    <td><b>REQUESTOR</b><br></td>
    				</tr>
    				<tr><td width="2%"></td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><font color="C35617"><label for="p_firstname">First Name &nbsp;</label></font><input type="text" onPaste="return false" value ="" name = "p_firstname" maxlength="25" size="20" alt="First Name" onkeypress="return lettersOnly(event)" >
    					<br><font color="C35617"><label for="p_lastname">Last Name &nbsp;</label></font><input type="text"  onPaste="return false" value ="" name = "p_lastname" maxlength="25" size="20" alt="Last Name" onkeypress="return lettersOnly(event)">
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><font color="C35617"><label for="p_domain_name">Email</label></font>
    					<input type="text" value ="" name = "p_domain_name" onPaste="return false" maxlength="25" size="20" alt="Domain Name" onChange=validateEmail(this.value)>
    					@myfwc.com
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><b><label for="DATA REQUEST">DATA REQUEST </label></b><br></td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_internal_use_only">Would data be for internal use only?</label>
    					<select name="p_internal_use_only" alt="Select if data will be used for internal use only"  >
    					<option value="Y"');
    					  if v_internal_use_only = 'Y' then
    					  htp.prn('selected');
    					  end if;
    					  	  htp.prn('>Yes</option>
    						    <option value="N"');
    					  if v_internal_use_only = 'N' then
    						htp.prn(' selected ');
    					  end if;
    					      htp.prn('>No</option>
    					</select>
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_target_date"> Target Date</label>
    					<input onchange=convert_date(this) type="text" value ="" name = "p_target_date" onPaste="return false" maxlength="25" size="10" alt ="Target Date"   >
    					<font size="-2">Ex. mm/dd/yyyy</font>
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td>
    					<label for="p_data_source"><font color="C35617">Data Source</font></label>
    					<input type="text" value ="" onPaste="return false" name = "p_data_source" maxlength="40" size="21" alt ="Data Request" >
    				<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_data_request"><font color="C35617"> Please give a detail description of the Data Request</font></label>
    					<br><textarea onPaste="return false" onchange="checkLength(this, maximumLength);" cols="60" rows="6" name="p_data_request" wrap="soft" alt="Please enter in description of Data Request"></textarea>
    					<br>
    					</td>
    				</tr>
    				<tr>
    				<td width="2%"></td>
    					<td><label for="p_output_columns"><font color="C35617">What fields would you like displayed? (Please seperate fields with a comma)</font></label>
    					<br><textarea onPaste="return false" onchange="checkLength(this, maximumLength);" cols="60" rows="6" name="p_output_columns" wrap="soft" alt="What fields would you like to display"></textarea>
    					<br>
    					</td>
    				</tr>
    				<tr>
    				<td width="2%"></td>
    					<td><label for="p_date_parameters">Please enter the desired reporting date parameters</label>
    					<br><textarea onPaste="return false" onchange="checkLength(this, maximumLength);" cols="60" rows="6" name="p_date_parameters" wrap="soft" alt="Please enter in Date Parameters"></textarea>
    					<br>
    					</td>
    				</tr>			
    				<tr><td width="2%"></td>
    					<td><b>OUTPUT</b>
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_output_format"> Output</label>
    					<select name="p_output_format" alt="Select a form of output">
    					<option value="MS"');
    					if v_output_format='MS' THEN
    					   htp.prn('selected');
    					end if;
    						htp.prn('>MS Access</option>
    					<option value="MS EXCEL"');
    					if v_output_format='MS EXCEL' then
    					   htp.prn('selected');
    					end if;
    						htp.prn('>Ms Excel</option>
    					<option value=".CSV"');
    					if v_output_format='.CSV' then
    					   htp.prn('selected');
    					end if;
    						htp.prn('>.CSV</option>
    					</select>
    					<font size="-2">if the file is too large data will be exported in appropriate format</font>
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_method_of_delivery">Method of Delivery</label>
    					<select name="p_method_of_delivery" alt ="Select a method of delivery" id="ValidID">
    					<option value="CD"');
    					if v_method_of_delivery='CD' then
    					htp.prn('selected');
    					end if;
    					htp.prn('>CD</option>
    					<option value="FTP"');
    					if v_method_of_delivery='FTP' THEN
    					   htp.prn('selected');
    					end if;
    						htp.prn('>FTP</option>
    					<option value="EMAIL"');
    					if v_method_of_delivery= 'EMAIL' THEN
    					   htp.prn('selected');
    					end if;
    						htp.prn('>EMAIL</option>
    					<option value="S.DRIVE"');
    					if v_method_of_delivery='S.DRIVE' then
    					   htp.prn('selected');
    					end if;
    						htp.prn('>S.DRIVE</option>
    					</select>
    					<div class="FrmDiv"  align="left">
    					<font color="C35617" size="-2"><label for="USER NAME">USER NAME</label></font>
    					<input type="text" alt="Please enter in FTP USER name" size="20" value="'||v_ftp_user||'" name="p_ftp_user">
    					<br>
    					<font color="C35617" size="-2"><label for="PASSWORD">PASSWORD &nbsp;</label></font><input type="password" alt="Please enter in FTP PASSWORD" value="'||v_ftp_password||'" size="20" name="p_ftp_password">
    					<br>
    					<font color="C35617" size="-2"><label for="HOST NAME">HOST NAME&nbsp;</label></font><input type="text" alt="Please enter in FTP HOST NAME" size="20" value="'||v_ftp_host||'" name="p_ftp_host">
    					</div>
    					<br>
    					<font size="-2">&nbsp;&nbsp;&nbsp;email cannot exceed 3MB </font>
    					<p><p>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td>
    					<input type ="hidden" alt="Hidden Field" name="p_requestor_id" value="'||v_requestor_id||'">
    					<input type="submit" value="Submit" alt="Submit Button" >
    					<input type ="reset" value="Clear" alt="Reset Button">
    					</td>
    				</tr>
                    </table>
    		    </form>' );
    
    
    
    
    	end if;
    
    
    
    else
    
    	if v_hold_value = 'R' THEN 
    
    	htp.prn('
    
    <form onsubmit="return validateOnSubmit()" name="UpdateDataRequest" action="'||g_v_fwcdevi||'fwc_www.lp_intra_pkg.lp_data_request_pr" method="post" >
    		<input type ="hidden" alt="Hidden Field" name="v_hold_value" value="U">	
    		   <table width=768>	
    	
    			    <tr><td width="2%"></td>
    				    <td><b>REQUESTOR</b><br></td>
    				</tr>
    				<tr><td width="2%"></td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><font color="C35617"><label for="p_firstname">First Name &nbsp;</label></font><input type="text" onPaste="return false" value ="'||v_firstname||'" name = "p_firstname" maxlength="25" size="20" alt="First Name" onkeypress="return lettersOnly(event)" >
    					<br><font color="C35617"><label for="p_lastname">Last Name &nbsp;</label></font><input type="text"  onPaste="return false" value ="'||v_lastname||'" name = "p_lastname" maxlength="25" size="20" alt="Last Name" onkeypress="return lettersOnly(event)">
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><font color="C35617"><label for="p_domain_name">Email</label></font>
    					<input type="text" value ="'||v_domain_name||'" name = "p_domain_name" onPaste="return false" maxlength="25" size="20" alt="Domain Name" onChange=validateEmail(this.value)>
    					@myfwc.com
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><b><label for="DATA REQUEST">DATA REQUEST </label></b><br></td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_internal_use_only">Would data be for internal use only?</label>
    					<select name="p_internal_use_only" alt="Select if data will be used for internal use only"  >
    					<option value="Y"');
    					  if v_internal_use_only = 'Y' then
    					  htp.prn('selected');
    					  end if;
    					  	  htp.prn('>Yes</option>
    						    <option value="N"');
    					  if v_internal_use_only = 'N' then
    						htp.prn(' selected ');
    					  end if;
    					      htp.prn('>No</option>
    					</select>
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_target_date"> Target Date</label>
    					<input onchange=convert_date(this) type="text" value ="'||v_char2||'" name = "p_target_date" onPaste="return false" maxlength="25" size="10" alt ="Target Date"   >
    					<font size="-2">Ex. mm/dd/yyyy</font>
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td>
    					<label for="p_data_source"><font color="C35617">Data Source</font></label>
    					<input type="text" value ="'||v_data_source||'" onPaste="return false" name = "p_data_source" maxlength="40" size="21" alt ="Data Request" >
    				<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_data_request"><font color="C35617"> Please give a detail description of the Data Request</font></label>
    					<br><textarea onPaste="return false" onchange="checkLength(this, maximumLength);" cols="60" rows="6" name="p_data_request" wrap="soft" alt="Please enter in description of Data Request">'||v_data_request||'</textarea>
    					<br>
    					</td>
    				</tr>
    				<tr>
    				<td width="2%"></td>
    					<td><label for="p_output_columns"><font color="C35617">What fields would you like displayed? (Please seperate fields with a comma)</font></label>
    					<br><textarea onPaste="return false" onchange="checkLength(this, maximumLength);" cols="60" rows="6" name="p_output_columns" wrap="soft" alt="What fields would you like to display">'||v_output_columns||'</textarea>
    					<br>
    					</td>
    				</tr>
    				<tr>
    				<td width="2%"></td>
    					<td><label for="p_date_parameters">Please enter the desired reporting date parameters</label>
    					<br><textarea onPaste="return false" onchange="checkLength(this, maximumLength);" cols="60" rows="6" name="p_date_parameters" wrap="soft" alt="Please enter in Date Parameters">'||v_date_parameters||'</textarea>
    					<br>
    					</td>
    				</tr>			
    				<tr><td width="2%"></td>
    					<td><b>OUTPUT</b>
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_output_format"> Output</label>
    					<select name="p_output_format" alt="Select a form of output">
    					<option value="MS"');
    					if v_output_format='MS' THEN
    					   htp.prn('selected');
    					end if;
    						htp.prn('>MS Access</option>
    					<option value="MS EXCEL"');
    					if v_output_format='MS EXCEL' then
    					   htp.prn('selected');
    					end if;
    						htp.prn('>Ms Excel</option>
    					<option value=".CSV"');
    					if v_output_format='.CSV' then
    					   htp.prn('selected');
    					end if;
    						htp.prn('>.CSV</option>
    					</select>
    					<font size="-2">if the file is too large data will be exported in appropriate format</font>
    					<br>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td><label for="p_method_of_delivery">Method of Delivery</label>
    					<select name="p_method_of_delivery" alt ="Select a method of delivery" id="ValidID">
    					<option value="CD"');
    					if v_method_of_delivery='CD' then
    					htp.prn('selected');
    					end if;
    					htp.prn('>CD</option>
    					<option value="FTP"');
    					if v_method_of_delivery='FTP' THEN
    					   htp.prn('selected');
    					end if;
    						htp.prn('>FTP</option>
    					<option value="EMAIL"');
    					if v_method_of_delivery= 'EMAIL' THEN
    					   htp.prn('selected');
    					end if;
    						htp.prn('>EMAIL</option>
    					<option value="S.DRIVE"');
    					if v_method_of_delivery='S.DRIVE' then
    					   htp.prn('selected');
    					end if;
    						htp.prn('>S.DRIVE</option>
    					</select>
    					<div class="FrmDiv"  align="left">
    					<font color="C35617" size="-2"><label for="USER NAME">USER NAME</label></font>
    					<input type="text" alt="Please enter in FTP USER name" size="20" value="'||v_ftp_user||'" name="p_ftp_user">
    					<br>
    					<font color="C35617" size="-2"><label for="PASSWORD">PASSWORD &nbsp;</label></font><input type="password" alt="Please enter in FTP PASSWORD" value="'||v_ftp_password||'" size="20" name="p_ftp_password">
    					<br>
    					<font color="C35617" size="-2"><label for="HOST NAME">HOST NAME&nbsp;</label></font><input type="text" alt="Please enter in FTP HOST NAME" size="20" value="'||v_ftp_host||'" name="p_ftp_host">
    					</div>
    					<br>
    					<font size="-2">&nbsp;&nbsp;&nbsp;email cannot exceed 3MB </font>
    					<p><p>
    					</td>
    				</tr>
    				<tr><td width="2%"></td>
    					<td>
    					<input type ="hidden" alt="Hidden Field" name="p_requestor_id" value="'||v_requestor_id||'">
    					<input type="submit" value="Submit" alt="Submit Button" >
    					<input type ="reset" value="Clear" alt="Reset Button">
    					</td>
    				</tr>
                    </table>
    		    </form>' );
    
    	
    
    	else
    			if v_hold_value = 'U' then 
    		   				   --update
    			UPDATE lp_data.lp_data_requests_tbl
    			SET firstname=nvl(p_firstname,v_firstname),
    			lastname=nvl(p_lastname,v_lastname),
    			data_request=nvl(p_data_request,v_data_request),
    			target_date=nvl(p_target_date,v_target_date),
    			data_source=nvl(p_data_source,v_data_source),
    			output_columns=nvl(p_output_columns,v_output_columns),
    			output_format=nvl(p_output_format,v_output_format),
    			method_of_delivery=nvl(p_method_of_delivery,v_method_of_delivery),
    			ftp_user=nvl(p_ftp_user,v_ftp_user),
    			ftp_password=nvl(p_ftp_password,v_ftp_password),
    			ftp_host=nvl(p_ftp_host,v_ftp_host),
    			domain_name=nvl(p_domain_name,v_domain_name),
    			date_parameters=nvl(p_date_parameters,v_date_parameters),
    			internal_use_only=nvl(p_internal_use_only,v_internal_use_only)
    			WHERE requestor_id=p_requestor_id;
    			COMMIT;
    			close data_request_cur;
    
    				htp.prn('
    		<font class="BodyDarkBlueLarge"> Confirmation</font>
    		<br><font class="BodyDarkBlueLarge">&nbsp;&nbsp; Information Updated</font>
    		<form name="ConfirmationPage" action ="'||g_v_fwcdevi||'fwc_www.lp_intra_pkg.lp_data_request_pr?p_menu_id='||p_menu_id||'&p_requestor_id='||v_requestor_id||'" method="post" >
    		 <table width=768>			
    			    <tr>
    					<td width="2%"></td>
    		       		<td>Request No. : '||v_requestor_id||'</td>
    		   	   </tr>
    		       <tr>
    				   <td width="2%"></td>
    		   		   <td>Date of Submission: '||v_char||'</td>
    			  </tr>
    		      <tr>
    				    <td width="2%"></td>
    					<td> First Name:'||v_firstname||'   </td>
    			 </tr>
    		     <tr>
    				    <td width="2%"></td>
    					<td>Last Name:  '||v_lastname||' </td>
    			</tr>
    		    <tr>
    				    <td width="2%"></td>
    					<td>Email: '||v_domain_name||' @myfwc.com </td>
    		 	</tr>
    		    <tr>
    				    <td width="2%"></td>
    			<td>Would data be used for internal use: '||v_internal_use_only||'</td>
    		     </tr>
    		     <tr>
    				    <td width="2%"></td>
    					<td>Target Date: '||v_char2||'</td>
    		     </tr>
    		     <tr>
    				    <td width="2%"></td>
    					<td>Data Source: '||v_data_source||' </td>
    		   </tr>
    		      <tr>
    				    <td width="2%"></td>
    			  <td>Description of Data Request:  '||v_data_request||' </td>
    		   </tr>
    		       <tr>
    				    <td width="2%"></td>
    		   <td>Fields to Display: '||v_output_columns||'</td>
    			</tr>
    			    <tr>
    				    <td width="2%"></td>
    			<td>Date Parameters:  '||v_date_parameters||'</td>
    			</tr>
    			    <tr>
    				    <td width="2%"></td>
    					<td>Output:'||v_output_format||' </td>
    			 </tr>
    			     <tr>
    				    <td width="2%"></td>
    					<td>Method of Delivery: '||v_method_of_delivery||'</td>
    			     </tr>
    		
    		<tr>
    		<td width="2%"></td>
    				<td><input type="submit" value="Back" alt="Back Button" ></td>
    				</tr>
    		</table>
    		</form>');
    
    
    					v_hold_value := 'R';
    
    
    
    
    	end if;
    
    
    
    
    
    end if;

  • #5
    New Coder
    Join Date
    Jun 2006
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Basically what i am doing is creating 4 pages 2 confirmation pages, 2 form pages one with blank values(insert) and the other with values for (update);

    and a series of hidden fields in the form name v_hold_value to see exactly what the user is try to do. if statement calls particular page to display but for some reason the hidden field values are not holding the values. I thought I knew how to use the hidden fields but , obviously I don't.


  •  

    Posting Permissions

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