/    Sign up×
Community /Pin to ProfileBookmark

Does this look right?

Can you all tell me if this looks correct to you. I’m trying to take a ColdFusion variable (#url.line_amount#), manipulate it, then pass the new value back to the previous page, and close the window. Anyone see anything wrong with this? I’m not generating any errors, it’s just that the link isn’t pointing sending the user back to the previous page or closing the window.

<script type=text/javascript>
{

line_amount = ‘#url.line_amount#’;
ineligible_field_name = ‘#page.ineligible_field#’;
ineligible = 0;
if(line_amount – fee < 0 )
ineligible = 0;
else if (line_amount – fee > 0 )
ineligible = 0;
else
ineligible = line_amount – fee;
opener.document.frmname.ineligible_field_name.value = ineligible;
self.close();
}
</script>

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@IndyBauthorAug 04.2003 — Anyone?
Copy linkTweet thisAlerts:
@SlankenOgenAug 04.2003 — Try this

<script type=text/javascript>

{

line_amount = '#url.line_amount#';

ineligible_field_name = '#page.ineligible_field#';

alert(ineligible_field_name);

ineligible = 0;

if(!(line_amount - fee == 0 )) {

ineligible = 0;

}else{

ineligible = line_amount - fee;

alert(ineligible);

}

opener.document.frmname.ineligible_field_name.value = ineligible;

self.close();

}

</script>

But your code ensures that ineligible will = 0 no matter what the results of line_amount - fee is so your if statements are redundant.
Copy linkTweet thisAlerts:
@IndyBauthorAug 04.2003 — Thanks for the reply.

That seems to be getting me closer to the goal. Using the code you provided, I now get a popup alert for the correct ineligible_field_name. But after i click OK, I have the same problems as before.
Copy linkTweet thisAlerts:
@SlankenOgenAug 04.2003 — opener.document.frmname.ineligible_field_name.value = ineligible;

self.close();


is correct. Can you post the form html from the opener.
Copy linkTweet thisAlerts:
@IndyBauthorAug 04.2003 — This is sort of a mess...

<form action="popup.worksheet.cfm?claim_id=#page.claim_id#" name="frmname" method="post">

<input type="hidden" name="frmaction" value="">

<input type="hidden" name="closewin" value="">

<input type="hidden" name="claim_id" value="#page.claim_id#">

<input type="hidden" name="num_lines" value="#check_li_detail.recordcount#">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td valign="middle" align="left" width="50%"><input type="button" value=" Close " onclick="window.close()"></td>

<td valign="middle" align="right" width="50%"><input type="button" value=" Save " onclick="dosave('N')">&nbsp;<input type="button" value="Save & Close" onclick="dosave('Y')"></td>

</tr>

</table>

<hr size="2" noshade>

<table width="100%" border="1" cellspacing="0" cellpadding="2">

<cfloop>

<tr>

<td align="center" valign="middle" class="xsmall">#set_id#</td>

<td align="center" valign="middle" class="xsmall">#line_id#</td>

<td valign="middle" class="xsmall">

<cfif set_id is 1>#DollarFormat(li_amount_array_1[line_id])#<cfset li_amount_total = li_amount_total + li_amount_array_1[line_id]><input type="hidden" name="li_amount_#set_id#_#line_id#" value="#replace(NumberFormat(li_amount_array_1[line_id], '999999999.00'), " ", "", "All")#"><cfset line_amount_pass = #li_amount_array_1[line_id]#></cfif>

<cfif set_id is 2>#DollarFormat(li_amount_array_2[line_id])#<cfset li_amount_total = li_amount_total + li_amount_array_2[line_id]><input type="hidden" name="li_amount_#set_id#_#line_id#" value="#replace(NumberFormat(li_amount_array_2[line_id], '999999999.00'), " ", "", "All")#"><cfset line_amount_pass = #li_amount_array_2[line_id]#></cfif>

</td>

<td valign="middle" class="xsmall">$<input type="text" name="ppo_allowed_#set_id#_#line_id#" value="#loop.ppo_allowed#" size="12" class="xsmall" style="{vertical-align:middle;}" onchange="this.value=currencyFormat(this.value);calculate_payable(#set_id#,#line_id#,'Y');dototal('ppoallowed');" onBlur="this.value=currencyFormat(this.value);calculate_payable(#set_id#,#line_id#,'Y');dototal('ppo_allowed');"></td>

<td valign="middle" class="xsmall">$<input type="text" name="deductible_#set_id#_#line_id#" value="#loop.deductible#" size="12" class="xsmall" style="{vertical-align:middle;}" onchange="this.value=currencyFormat(this.value);dototal('deductible');calculate_payable(#set_id#,#line_id#,'Y');" onBlur="this.value=currencyFormat(this.value);dototal('deductible');calculate_payable(#set_id#,#line_id#,'Y');"></td>

<td valign="middle" class="xsmall">$<input type="text" name="ineligible_#set_id#_#line_id#" value="#loop.ineligible#" size="12" class="xsmall" style="{vertical-align:middle;}" onchange="this.value=currencyFormat(this.value);dototal('ineligible');calculate_payable(#set_id#,#line_id#,'Y');" onBlur="this.value=currencyFormat(this.value);dototal('ineligible');calculate_payable(#set_id#,#line_id#,'Y');"></td>

<td valign="middle" class="xsmall"><input type="text" name="payable_percent_#set_id#_#line_id#" value="#loop.payable_percent#" size="3" class="xsmall" style="{vertical-align:middle;}" onchange="this.value=reformatPercentage(this.value);calculate_payable(#set_id#,#line_id#,'Y');" onblur="this.value=reformatPercentage(this.value);calculate_payable(#set_id#,#line_id#,'Y');">%</td>

<td valign="middle" class="xsmall">$<input type="text" name="payable_amount_#set_id#_#line_id#" value="#loop.payable_amount#" size="12" class="xsmall" style="{border: 0px;vertical-align:middle;}" readonly></td>

<cfif claim_info.policy_id IS 3>

<cfset ineligible_field = "ineligible_"&#set_id#&"_"&#line_id#>

<td valign="middle" class="xsmall" align="center"><a href="javascript: worksheet(#page.claim_id#,#set_id#,#line_id#,'#line_amount_pass#','#ineligible_field#')"><img src="/pics/button.magnify.gif" width="17" height="21" border="0"></a></td>

<script>

function worksheet(claim_id,set_id,line_id,line_amount_pass,ineligible_field)

{

url = "/application/claims/admin/adjudicate/popup.worksheet.fee_schedule.cfm?claim_id="+claim_id+"&set_id="+set_id+"&line_id="+line_id+"&line_amount="+line_amount_pass+"&ineligible_field="+ineligible_field;

dopopup(url,'#replace(createuuid(), "-", "_", "All")#',Number(screen.availWidth-200),Number(screen.availHeight-300),0,0,'yes','yes','yes','yes','yes','yes','yes','yes','yes','yes');

}

</script>

</cfif>

<td align="center" valign="middle" class="xsmall"><a href="javascript: alert('#IIf(benefit_code is "", DE("NA"), DE("[" & benefit_code & "] " & benefit_desc))#')" title="#IIf(benefit_code is "", DE("NA"), DE("[" & benefit_code & "] " & benefit_desc))#">#IIf(benefit_code is "", DE("NA"), DE(benefit_code))#</a>&nbsp;/&nbsp;<a href="javascript: benefitcode(#claim_id#,#set_id#,#line_id#)" title="Edit">E</a></td>
<td align="center" valign="middle" class="xsmall"><a href="javascript: alert('#IIf(classification_code is "", DE("NA"), DE("[" & classification_code & "] " & classification_desc))#')" title="#IIf(classification_code is "", DE("NA"), DE("[" & classification_code & "] " & classification_desc))#">#IIf(classification_code is "", DE("NA"), DE(classification_code))#</a>&nbsp;/&nbsp;<a href="javascript: classificationcode(#claim_id#,#set_id#,#line_id#)" title="Edit">E</a></td>
<td align="center" valign="middle" class="xsmall"><a href="javascript: alert('Remark Codesnn<cfloop query="remark_codes">[#remark_code#] #remark_desc#n</cfloop>')" title="Remark Codes#chr(13)##chr(13)#<cfloop query="remark_codes">[#remark_code#] #remark_desc##chr(13)#</cfloop>">#IIf(remark_codes.recordcount is 0, DE("NA"), DE(remark_codes.recordcount))#</a>&nbsp;/&nbsp;<a href="javascript: remarkcode(#claim_id#,#set_id#,#line_id#)" title="Edit">E</a></td>
<td align="center" valign="middle" class="xsmall"><img src="#IIf(underwriter_logo is "", DE("/pics/icon_unknown.gif"), DE(underwriter_logo))#" width="18" height="18" alt="#alt_text#" align="absmiddle" border="0">&nbsp;/&nbsp;<a href="javascript: riskassignment(#claim_id#,#set_id#,#line_id#)" title="Edit">E</a></td>
<td align="center" valign="middle" class="xsmall"><input type="checkbox" name="reprice" value="#set_id#_#line_id#" #IIf(reprice is 1, DE("checked"), DE(""))#></td>

</tr>

</cfloop>

<tr bgcolor="#client.css.row0_bgcolor#">

<td align="center" valign="middle" class="xsmall" colspan="2"><b>Total</b></td>

<td valign="middle" class="xsmall">$<input type="text" name="total_li_amount" value="#li_amount_total#" size="12" class="xsmall" style="{border: 0px;vertical-align:middle;background-color:#client.css.row0_bgcolor#;}" readonly></td>

<td valign="middle" class="xsmall">$<input type="text" name="total_ppo_allowed" value="#ppo_allowed_total#" size="12" class="xsmall" style="{border: 0px;vertical-align:middle;background-color:#client.css.row0_bgcolor#;}" readonly></td>

<td valign="middle" class="xsmall">$<input type="text" name="total_deductible" value="#deductible_total#" size="12" class="xsmall" style="{border: 0px;vertical-align:middle;background-color:#client.css.row0_bgcolor#;}" readonly></td>

<td valign="middle" class="xsmall">$<input type="text" name="total_ineligible" value="#ineligible_total#" size="12" class="xsmall" style="{border: 0px;vertical-align:middle;background-color:#client.css.row0_bgcolor#;}" readonly></td>

<td valign="middle" class="xsmall">&nbsp;</td>

<td valign="middle" class="xsmall">$<input type="text" name="total_payable_amount" value="#payable_amount_total#" size="12" class="xsmall" style="{border: 0px;vertical-align:middle;background-color:#client.css.row0_bgcolor#;}" readonly></td>

<cfif claim_info.policy_id IS 3><td valign="middle" class="xsmall">&nbsp;</td></cfif>

<!--- Hawaii SHOTT information --->

<cfif check_li_detail.tpl neq "" and check_li_detail.claim_status_reason neq ""><cfset page.colspan = "7"><cfelse><cfset page.colspan="5"></cfif>

<td align="center" valign="middle" class="xsmall" colspan="#page.colspan#"><input type="button" value="Re-Calculate" onclick="calculateall()" class="xsmall"></td>

</tr>

</table>

<hr size="2" noshade>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td valign="middle" align="left" width="50%"><input type="button" value=" Close " onclick="window.close()"></td>

<td valign="middle" align="right" width="50%"><input type="button" value=" Save " onclick="dosave('N')">&nbsp;<input type="button" value="Save & Close" onclick="dosave('Y')"></td>

</tr>

</table>

</form>
Copy linkTweet thisAlerts:
@SlankenOgenAug 05.2003 — You need to make a very simple form to test the code. Just a form with one text field. If that works you know the code works and can then look at the real form for glitches.
×

Success!

Help @IndyB spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...