Need Help With Custom Calculation Script
Hey everyone. I'm using Acrobat Pro X and stumbling a bit on the syntax for the following equation. I need to add the value of "Cell1" & "Cell2" then add the value of "Cell3". However,the value of "Cell3" is entered by the user and specifies a percentage of the sum of "Cell1 & "Cell2". For example: If the user enters "3" into "Cell3" I need the returned value to be 3% of the sum of "Cell1" + "Cell2". If the user enters "9" into "Cell3" I need the returned value for "Cell3" to be 9% of the sum of "Cell1 & Cell2" and the end result needs to be the sum of "Cell1+Cell2+Cell3". In greater detail:
If "Cell1" = $500, "Cell2" = $500 and "Cell3" = "3" then I need the returned value to be $1030.00.
I hope this makes sense. Here's what I have so far but alas, it's not working. Any help would be GREATLY appreciated.
// Get first field value, as a number
var v1 = +getField("Cell1").value;
// Get second field value, as a number
var v2 = +getField("Cell2").value;
// Get processing field value, as a number
//var v3 = +getField("Cell3"/100).value;
// Calculate and set this field's value to the result
event.value = v3+(v1+v2);
Thanks,
Solan
I posted an answer but realized it wasn't what you wanted. There is some confusion about what you want for Cell3. On the one hand, you say you want the user to enter a vaule in the field, but them you say you want its value to be calculated based on what the user enters and two other field values. It seems to me Cell3 should be the field that the user enters the percentage and the calculated field's (Cell4) script could then be:
// Get first field value, as a number
var v1 = +getField("Cell1").value;
// Get second field value, as a number
var v2 = +getField("Cell2").value;// Get processing field value, as a number
// Get the percentage
var v3 = +getField("Cell3").value;
// Calculate and set this field's value to the result
event.value = (1 + v3 / 100) * (v1 + v2);
Similar Messages
-
Need Assistance With Custom Calculation Script
I need help with a custom calculation script in Acrobat Pro. I am trying to add the sum of fields A, B, C, D, E, F, and G together with the lesser value of fields H and I. What would be the script to enter for this result? Thank you.
event.value = Number(this.getField("A").value) + Number(this.getField("B").value) + Number(this.getField("C").value) + Number(this.getField("D").value) + Number(this.getField("E").value) + Number(this.getField("F").value) + Number(this.getField("G").value) + Math.min(Number(this.getField("H").value), Number(this.getField("I").value));
-
Help with Custom calculation script in Acrobat 8
Hi all, I am using acrobat 8 on OS 10.5
I am trying to add certain fields (numbers) and then subtract another field value to give an end result.
I don't know anything about Javascript, would anyone be able to help with any info on how I achieve this result? I can only see Add, x and average etc... nothing there for subtraction
Thanks for any help in advance
SwenThis should get you started:
>if (event) {
// get values from two text fields
var a = Number(this.getField('Text1').value);
var b = Number(this.getField('Text2').value);
// subtract the values and show it
this.event.target.value = a - b;
Place this in a 3d text field, as a Custom Calculation Script. -
Need help with form calculations
I'm converting a non-editable PDF form into an editable one and could use some help as I'm am new to this. Note: I did not create the non-editable form, It's a form I downloaded and use in my business.
I already figured out how to create text fields in the already created PDF non-editable form, now I'm trying to add in calculations. I can create the (value is the) calculations between 2 or more text fields, but now I need to multiply one text field by the number 3 and have the answer show up in another text field.
Example:
I'll use the letters A & B for the text filed names in my example.
I have text field A calculating the sum of other text fields using the (value is the sum of) option under the (calculate properties box.)
Now I want text field B to multiply text field A by a fixed number of 3. (A=24) x 3=72. I need text field B to have the answer of 72 in it.
I need text field B to always multiply text field A by 3.
Does anyone know how I can accomplish this?
I'm using Adobe 8 Pro.
Please note that I have no experiance using custom calculation script if that is the only way this will work and will step by step instruction on how to write the code.
Thank you very much.You can use the simplified field notation option. In this case, you'd enter:
3 * A
Where "A" the the exact name of the A field. It is best to avoid spaces and any other special characters for any fields that you'll want to include when using simplified field notation option. -
[solved]Need help with a bash script for MOC conky artwork.
I need some help with a bash script for displaying artwork from MOC.
Music folders have a file called 'front.jpg' in them, so I need to pull the current directory from MOCP and then display the 'front.jpg' file in conky.
mocp -Q %file
gives me the current file playing, but I need the directory (perhaps some way to use only everything after the last '/'?)
A point in the right direction would be appreciated.
thanks, d
Last edited by dgz (2013-08-29 21:24:28)Xyne wrote:
You should also quote the variables and output in double quotes to make the code robust, e.g.
filename="$(mocp -Q %file)"
dirname="${filename%/*}"
cp "$dirname"/front.jpg ~/backup/art.jpg
Without the quotes, whitespace will break the code. Even if you don't expect whitespace in any of the paths, it's still good coding practice to include the quotes imo.
thanks for the tip.
here it is, anyhow:
#!/bin/bash
filename=$(mocp -Q %file)
dirname=${filename%/*}
cp ${dirname}/front.jpg ~/backup/art.jpg
then in conky:
$alignr${execi 30 ~/bin/artc}${image ~/backup/art.jpg -s 100x100 -p -3,60}
thanks for the help.
Last edited by dgz (2013-08-29 21:26:32) -
Error message with custom calculation script
I am currently trying to add two fields and multiply them by another. I got the script working, however, when I clear the form, i get this message:
"The value entered does not match the format of the field [total.sectionA]"
Here is what I have entered into the custom calculation window:
event.value = (this.getField("sponsor.level").value +
this.getField("sponsor.addedtabs").value ) *
this.getField("total.months").value;
I'm not very knowledgeable in the area of Java, and would rather use a simple field notation. But I can't get that to work at all. Here is what I have tried:
(sponsor.level + sponsor.addedtabs) * total.months
Thanks in advance for any help or advice that comes my way!
i'Simplified field notation' will not work because you are not using simplified field names. You can not use spaces, dots, or other special characters in the 'simplified field notation'. You can also not use any method, function, or any type of control statement.
What are all the possible values of the 'sponsor.level'?
Are there any other calculations in the form?
Are you perforning a division anywhere else on the form? -
DAX - Need help with TotalYTD calculation with Rolling 12 Months (Fiscal Months)
These are the tables I currently have in my solution:
DimDate - date dimension - our fiscal periods don't match with calendar periods
Fact Claims - ID, Date, Doc#, Amount, ProductKey
DimDateR12 - fiscal periods with max and min calendar dates - using DatesAdd gave me error because of contiguous dates error, so ended up using this.
Here are the calculations -
Issue Count = Distinct count of Products where (Sum of amount >= 1000 and count of claims >= 5) in last 12 fiscal periods - I am using summarize function here.
I need to add another calculation where I need to count issues resolved.
Issues resolved = Distinct count of products, where Rolling 12 Claims Amount >= 1000 and claim count >= 5 in the previous fiscal period) and Current fiscal period, NOT(Rolling 12 Claims Amount >= 1000 AND claim count >= 5) - this needs
to be a cumulative calculation.
I got Issues Resolved Calculation to work with summarize function, but using TotalYTD (using Fiscal Date key) to get cumulative number, is not working. Here is my calculation - TotalYTD([Count of Issues Resolved],DimDateR12[FiscalDate])
I tried using All(DimDateR12) filter, but didn't work.
Any help is really appreciated.
Thanks,
SonalThese are the calculations I am currently using -
Rolling12ClaimCount:=CALCULATE(FactClaim[ClaimCount],FILTER(DimDate,AND(DimDate[Calendar Date] >= Min(DimDateR12[StartDate]),DimDate[Calendar Date] <= Max(DimDateR12[EndDate]))))
Rolling12ClaimAmount:=CALCULATE(FactClaim[ClaimAmount],FILTER(DimDate,AND(DimDate[Calendar Date] >= Min(DimDateR12[StartDate]),DimDate[Calendar Date] <= Max(DimDateR12[EndDate]))))
IsCurrentIssue:=IF(([Rolling12ClaimAmount] >= 1000) && ([Rolling12ClaimCount] >= 5),TRUE(),FALSE())(([Rolling12ClaimAmount] >= 1000) && ([Rolling12ClaimCount] >= 5),TRUE(),FALSE())
WasWarrantyIssue:=IF(([PrevFiscalPeriodRolling12ClaimAmount] >= 1000) && ([PrevFiscalPeriodRolling12ClaimCount] >= 5),TRUE(),FALSE())
Resolvedissues:=IF(AND([IsWarrantyIssue]=FALSE(),[WasWarrantyIssue]=TRUE()),1,0)
Rolling12IssuesResolved:=SUMX(SUMMARIZE(FactClaim,FactClaim[ProductKey],"ResolvedIssueCount",[Resolvedissues]),[ResolvedIssueCount])
YTDResolvedIssues:=TotalYTD([Rolling12IssuesResolved],DimDateR12[FiscalDate])
-- Fiscal Date is <Fiscal Period>/1/<Fiscal year>
Thanks,
Sonal -
Need Help Writing a Calculation Script Using a Checkbox
Hello,
I am new to Adobe X Standard and Javascript. I have all other parts of my fillable change order form completed except the tax calculation. I have the following fields:
Text Field = SUBTOTAL
Text Field = TAX
Checkbox = Exempt
I would like the calculation in the TAX field to be as follows:
If the checkbox = false then SUBTOTAL * .05, else SUBTOTAL = 0.
It really doesn't seem that complex but learning javascript on the fly is apparently above my skill level. I would greatly appreciate someone's help in getting this initial calculation working. I greatly appreciate your time. Thank you.Your description is a bit confusing to me. Do you want to calculate the value of the TAX field? In the last bit of pseudocode, you seem to be setting SUBTOTAL to 0. Do you want the tax to be the SUBTOTAL value times 0.05 if not exempt and 0 if exempt? If so, the custom calculate script of the TAX field can be:
event.value = getField("Exempt").value === "Off" ? +getField("SUBTOTAL").value * 0.05 : 0;
This is equivalent to:
if (getField("Exempt").value === "Off") {
event.value = +getField("SUBTOTAL").value * 0.05;
} else {
event.value = 0; -
Need help with preforming calculations on a form
i'm working on a form in desinger 7 and i need to proform some calculations
thanks fredpart of for below. its just basic but i have never done this before in desiner
thanks fred -
Need help with PHP mail script [was: Can someone please help me?]
I'm trying to collect data from a form and email it. I'm using form2mail.php and the problem is that the email is not collecting the form info and it has the same email address in the From: and To: lines. I'm really stuck and would appreciate any help.
Here is the HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Contact Us</title>
<style type="text/css">
<!--
.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style2 {
font-size: 14px;
color: #000000;
body {
background-color: #FFFFFF;
body,td,th {
color: #CC3300;
.style3 {font-size: 14px; font-weight: bold; }
.style6 {font-size: 18px}
.style7 {font-size: 16px}
.style8 {font-size: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style9 {font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
.style10 {color: #000000}
-->
</style>
</head>
<body>
<div align="center"><img src="nav2.jpg" alt="nav bar" width="698" height="91" border="0" usemap="#Map2" />
<map name="Map2" id="Map2">
<area shape="rect" coords="560,9,684,38" href="accessories.html" />
<area shape="rect" coords="456,8,548,38" href="contact.html" />
<area shape="rect" coords="305,8,435,40" href="photog.html" />
<area shape="rect" coords="187,9,283,39" href="services.html" />
<area shape="rect" coords="81,10,167,39" href="aboutus.html" />
<area shape="rect" coords="5,10,68,39" href="index.html" />
</map>
<map name="Map" id="Map">
<area shape="rect" coords="9,9,69,39" href="index.html" />
<area shape="rect" coords="83,11,165,39" href="aboutus.html" />
<area shape="rect" coords="182,9,285,38" href="services.html" />
<area shape="rect" coords="436,14,560,37" href="contact.html" />
<area shape="rect" coords="563,14,682,38" href="accessories.html" />
</map>
</div>
<p> </p>
<form id="TheForm" name="TheForm" action="form2mail.php" method="post">
<p align="center" class="style2">P<span class="style1">lease fill out form below for a "free no obligation quote" then click submit.</span></p>
<p align="center" class="style3">(*Required Information)</p>
<div align="center">
<pre><strong><span class="style8">*Contact Name</span> </strong><input name="name" type="text" id="name" />
<span class="style8"><strong>
Business Name </strong></span><input name="bn" type="text" id="bn" />
<span class="style8"><strong>*Phone Number <input type="text" name="first" size="3" onFocus="this.value='';"
onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.second);" maxlength="3" value="###" /> - <input type="text" name="second" size="3" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.third);" maxlength="3" value="###" /> - <input type="text" name="third" size="4" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.fourth);" maxlength="4" value="####"/> </strong></span>
<strong><span class="style1">*</span><span class="style8">Email Address</span> <input name="email" type="text" id="email" /> </strong> </pre>
<label><span class="style9">*Re-enter to confirm</span>
<input name="emx" type="text" id="emx" /></label><br /><br /><span class="style9">
<label></label>
</span>
<p><span class="style9">*Best time to call </span>
<select name="name1[]" multiple size="1" >
<option>8am-9am</option>
<option>9am-10am</option>
<option>10am-11am</option>
<option>11am-12pm</option>
<option>12pm-1pm</option>
<option>1pm-2pm</option>
<option>2pm-3pm</option>
<option>3pm-4pm</option>
<option>4pm-5pm</option>
<option>5pm-6pm</option>
<option>6pm-7pm</option>
<option>7pm-8pm</option>
</select>
<br />
<br />
<span class="style9">Type of Location</span>
<select name="name2[]" multiple size="1" >
<option>Residential</option>
<option>Commercial</option>
</select>
<br />
<br />
<span class="style1"><br />
<strong><br />
<span class="style6">*Type of Services Requested:</span></strong><br />
</span><strong><span class="style10">(check all that apply)</span><br />
</strong><br />
<span class="style7"><span class="style1"><strong>Janitorial cleaning</strong></span>
<input type="checkbox" name="checkbox[]" value="checkbox" multiple/>
<br />
</span><strong><br />
<span class="style8">Mobile Auto Detailing</span>
<input type="checkbox" name="checkbox2[]" value="checkbox" multiple/>
<br />
<br />
</strong><span class="style9">Moving/Hauling</span>
<input type="checkbox" name="checkbox3[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Pressure washing</span>
<input type="checkbox" name="checkbox4[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Window washing</span>
<input type="checkbox" name="checkbox5[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Window Tinting</span>
<input type="checkbox" name="checkbox6[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Boat cleaning</span>
<input type="checkbox" name="checkbox7[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">RV cleaning</span>
<input type="checkbox" name="checkbox8[]" value="checkbox" multiple/>
<br />
<br />
<span class="style9">Motorcycle cleaning</span>
<input type="checkbox" name="checkbox9[]" value="checkbox" multiple/>
<br />
<br />
<br />
<br />
<input name="SB" type="button" class="style9" value="Submit" onClick="sendOff();">
</p>
</div></label>
<script language="JavaScript1.2">
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
var good;
function checkEmailAddress(field) {
// Note: The next expression must be all on one line...
// allow no spaces, linefeeds, or carriage returns!
var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org) |(\..{2,2}))$)\b/gi);
if (goodEmail){
good = true
} else {
alert('Please enter a valid e-mail address.')
field.focus()
field.select()
good = false
function autoTab(startPoint,endPoint){
if (startPoint.getAttribute&&startPoint.value.length==startPoint.getAttribute("max length"))
endPoint.focus();
function checkNumber(phoneNumber){
var x=phoneNumber;
var phoneNumber=/(^\d+$)|(^\d+\.\d+$)/
if (phoneNumber.test(x))
testResult=true
else{
alert("Please enter a valid number.")
phoneNumber.focus();
phoneNumber.value="";
testResult=false
return (testResult)
function sendOff(){
namecheck = document.TheForm.name.value
if (namecheck.length <1) {
alert('Please enter your name.')
return
good = false
checkEmailAddress(document.TheForm.email)
if ((document.TheForm.email.value ==
document.TheForm.emx.value)&&(good)){
// This is where you put your action
// if name and email addresses are good.
// We show an alert box, here; but you can
// use a window.location= 'http://address'
// to call a subsequent html page,
// or a Perl script, etc.
window.location= 'form2mail.php';
if ((document.TheForm.email.value !=
document.TheForm.emx.value)&&(good)){
alert('Both e-mail address entries must match.')
</script>
</form>
<p> </p>
</body>
</html>
and here is the form2mail.php:
<?php
# You can use this script to submit your forms or to receive orders by email.
$MailToAddress = "[email protected]"; // your email address
$redirectURL = "http://www.chucksmobile.com/thankyou.html"; // the URL of the thank you page.
$MailSubject = "[Customer Contact Info]"; // the subject of the email
$sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail
$serverCheck = FALSE; // if, for some reason you can't send e-mails, set this to "false"
# copyright 2006 Web4Future.com =================== READ THIS ===================================================
# If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
# If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.
# To block an IP, simply add it to the blockip.txt text file.
# CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)
# This is needed because the script tries to block the IP that tried to hack it
# If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"
# you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>
# you have to do the same with checkboxes
Web4Future Easiest Form2Mail (GPL).
Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.
http://www.Web4Future.com/
This script was written by George L. & Calin S. from Web4Future.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
# DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
$w4fver = "2.2";
$ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);
//function blockIP
function blockip($ip) {
$handle = @fopen("blockip.txt", 'a');
@fwrite($handle, $ip."\n");
@fclose($handle);
$w4fx = stristr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR'));
if ($serverCheck) {
if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }
} else { $w4fy = TRUE; }
if (($w4fy === TRUE) && ($w4fx === FALSE)) {
$w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body><font face=3Dverdana size=3D2>";
if (count($_GET) >0) {
reset($_GET);
while(list($key, $val) = each($_GET)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
$w4fMessage .= "<br>\n";
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
} // end while
}//end if
else {
reset($_POST);
while(list($key, $val) = each($_POST)) {
$GLOBALS[$key] = $val;
if (is_array($val)) {
$w4fMessage .= "<b>$key:</b> ";
foreach ($val as $vala) {
$vala =stripslashes($vala);
$vala = htmlspecialchars($vala);
if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
$w4fMessage .= "$vala, ";
$w4fMessage .= "<br>\n";
else {
$val = stripslashes($val);
if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
if (($key == "Submit") || ($key == "submit")) { }
else { if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
} // end while
}//end else
$w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";
$w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");
$name = preg_replace($w4f_what, "", $name);
$email = preg_replace($w4f_what, "", $email);
if (!$email) {$email = $MailToAddress;}
$mailHeader = "From: $name <$email>\r\n";
$mailHeader .= "Reply-To: $name <$email>\r\n";
$mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";
$mailHeader .= "MIME-Version: 1.0\r\n";
if ($sendHTML) {
$mailHeader .= "Content-Type: multipart/alternative;";
$mailHeader .= " boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";
$mailHeader .= "X-Priority: 3\r\n";
$mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";
$mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
if ($sendHTML) {
$mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
$mailMessage .= "Content-Type: text/html; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= "$w4fMessage\r\n\r\n";
$mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";
if ($sendHTML === FALSE) {
$mailHeader .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";
$mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}
else { header("Location: ".$redirectURL); }
} else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}
?>
Thanks in advance,
Glenn
[Subject line edited by moderator to indicate nature of request]Using PHP to process an online form and send the input by email is very simple. The mail() function takes a minimum of three arguments, namely: the address the mail is being sent to, the subject line, and the body of the email as a single string. The reason some people use scripts like form2mail.php is because they don't have the knowledge or patience to validate the user input to make sure it's safe to send.
Rather than attempt to trawl through your complex form looking for the problems, I would suggest starting with a couple of simple tests.
First of all, create a PHP page called mailtest.php containing the following script:
<?php
$to = '[email protected]'; // use your own email address
$subject = 'PHP mail test';
$message = 'This is a test of the mail() function.';
$sent = mail($to, $subject, $message);
if ($sent) {
echo 'Mail was sent';
} else {
echo 'Problem sending mail';
?>
Save the script, upload it to your server, and load it into a browser. If you see "Mail is sent", you're in business. If not, it probably means that the hosting company insists on the fifth argument being supplied to mail(). This is your email address preceded by -f. Change the line of code that sends the mail to this:
$sent = mail($to, $subject, $message, null, '[email protected]');
Obviously, replace "[email protected]" with your own email address.
If this results in the mail being sent successfully, you will need to adapt the code in form2mail.php to accept the fifth parameter. You need to change the following line, which is a few lines from the end of the script:
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader))
Change it to this:
if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader, '[email protected]'))
Again, use your own email address instead of "[email protected]".
Once you have determined whether you need the fifth argument, test form2mail.php with a very simple form like this:
<form id="form1" name="form1" method="post" action="form2mail.php">
<p>
<label for="name">Name:</label>
<input type="text" name="name" id="name" />
</p>
<p>
<label for="email">Email:</label>
<input type="text" name="email" id="email" />
</p>
<p>
<label>
<input type="checkbox" name="options[]" value="boat cleaning" id="options_0" />
Boat cleaning</label>
<br />
<label>
<input type="checkbox" name="options[]" value="RV cleaning" id="options_1" />
RV cleaning</label>
<br />
<label>
<input type="checkbox" name="options[]" value="motorcycle cleaning" id="options_2" />
Motorcycle cleaning</label>
</p>
<p>
<input type="submit" name="send" id="send" value="Submit" />
</p>
</form>
If that works, you can start to make the form more complex and add back your JavaScript validation. -
Need help with custom column in BI Publisher
Hi Guru's
I have started working with BI Publisher Recently and need with below issue
Can you please let me know how can i create a custom column like % based on two existing measures in the report
I tried creating it in obiee report and used that SQL to create BI Publisher Report , but the result column in obiee is not working as expected in BI Publisher,
can some one please help me with this
Thanks a lot in advance.This column can be calculated in BIP RTF template. But if it is a column inside a FOR-loop
then it may need to be calculated slightly different.
Like I said, get the xml data and rtf then send it to me : [email protected]
and will get it fixed for you.
thanks
Jorge -
Help with a Calculation Script
I'm not sure if this is possible or not, but I have two checkboxe options on a form. When an item is checked, I want the total form to update, but I can't get it to work.
So CalcLine1 is a checkbox with an on value of $825.12
and CalcLine2 is a checkbox with an on value of $20
As the boxes are checked, I want the numeric field CalcTotal to update. I have it set with a Value Type of Calculated-Read only, but don't know where to go next.Hi,
I am a new user and need to do some simple calculations, preferably without creating script. I have a series of check boxes which I want to equal "1" when checked. I need them to subtotal and then total.
I am using LiveCycle 8.0. There is no database behind this form although that would be a possible future enhancement.
Also - is there a good resource for understanding the basic manipulation of forms - answering questions like - What is a sub form? Can I insert a field in the middle of the form and have everything move down? Everything I have found deals with a more complex level of form creation, yet the help screens don't give enough of the underlying concepts. Thanks! -
Need help with a calculated column - is there any way to reference a value in the current row?
Hey guys,
I'm a bit of a DAX newbie, and I'm running into a block. I'm creating a Power View report about IT tickets. We are going to be creating a cube to automate the data soon, I'm currently working with a flat Excel Data Table of data to demonstrate the Power
View reporting capabilities to the team. I need the default display to show the top 4-5 items basked on the Ticket Count. The three applicable columns I'm using are the TicketID, the ContactReason, and the AssetCategory - all three are
text. One slide will show the top five Contact Reasons by Ticket Count, and the other will show the top five Categories by Ticket Count. The users will see this default view, but will be able to change it to see differently ranked items or can clear the
ranking slicer altogether.
What I've accomplished so far is to create the Calculated Field [Ticket Count] = COUNTA(Table1[TicketID])
And 2 other calculated fields:
[Contact Rank] = RANKX(ALL(Table1[ContactReason]),[Ticket Count],,,DENSE)
[Asset Rank] = RANKX(ALL(Table1[AssetCategory]),[Ticket Count],,,DENSE)
If I were creating a Pivot Table, this would be great. These fields calculate everything the right way. The problem is, I need to have a Rank slicer on each slide and the calculation by itself contains no data - with no data, there's nothing to slice. I
realized I need to actually have columns of data so I can create a slicer. I need each row of the table to show the same [Contact Rank] for every instance of a particular ContactReason (and the same for the [Asset Rank] and AssetCategory).
The RANKX formulas pasted into the Calculated Column section only show a value of 1 - with no Pivot table summarizing the fields, it's counting each row's ticket once, giving every line the tied Rank of #1.
I've solved the problem in Excel by creating 2 Pivot Tables on a separate sheet that have the data field and the calculated field for ContactRason and AssetCategory. Then on my Excel Data Table, I've added two columns that do a VLOOKUP and pull over a the
Calculated Rank from each Pivot Table that match the ContactReason and AssetCategory fields. This works on the flat Excel Data Table now, but will not be a solutions when we start pulling the data from the cube (and there is no flat table).
What I think I need is an Expression for the RANKX formula that can give me, for each row, the count of all of the times a ContactReason shows up in an entire column. There's only about 100,000 lines of data and each ContactReason or AssetCategory
may show up several thousand times. But if I can get the expression to return that count, then the RANKX formula should work in the Column. If it wasn't a DAX formula, I'd use a COUNTIF and say 'Count the entire ContactReason column anytime it's equal to the
ContactReason on THIS row', but in DAX I don't know how to reference a single value in a row. I've tried the CALCULATE() formula, but it seems like the filter needs a specific value, and doesn't work on a dynamic "cell" value.
Any help would be greatly appreciated! (I hope it all makes sense!)If I've understood you correctly then the ALLEXCEPT function may be what you're after and it could be applied in a similar way to the following...
=
RANKX(
ALL(Table1),
CALCULATE(
COUNTROWS(table1),
ALLEXCEPT(Table1, Table1[ContactReason])
DENSE
If this has missed the mark, would it be possible to clarify the requirement further?
Regards,
Michael Amadi
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
Website: http://www.nimblelearn.com
Blog: http://www.nimblelearn.com/blog
Twitter: @nimblelearn -
Need help with customizing standard reports in Fusion Applications
Hi,
I have requirement to customize 'Asset Transfer Report' in Oracle Fusion.
This report is a BI Publisher report and Data Model lies in folder '/Share Folders/Financials/Fixed Assets/Tracking/Data Model' and report lies in folder '/Share Folders/Financials/Fixed Assets/Tracking'.
Steps which i have completed
I am trying to customize this report, i followed the below steps
Step 1:-
Copied Data Model into '/Shared Folder/Custom/Financials/Fixed Assets/Tracking/Data Model' and report into '/Shared Folder/Custom/Financials/Fixed Assets/Tracking/'
Step 2:-
Opened task 'Manage Custom Enterprise Scheduler Jobs for Ledger and Related Applications' and created a job with the following details.
Job Definition
Field Name
Value
Display Name
XX Asset Transfers Report
Name
XX_ASSET_TRANSFERS_REPORT
Path
/FA/
Application
Financials Common Module
Description
XX Asset Transfers Report
Job Application Name
FinancialsEss
Enable Submission from Enterprise Manager
Job Type
BIPJobType
Class Name
oracle.xdo.service.client.scheduler.BIPJobExecutable
Default Output Format
Report ID
/Custom/Financials/Fixed Assets/Tracking/Asset Transfers Report.xdo
Priority
Allow Multiple Pending Submissions
False
Enable Submission From Scheduled Processes
Yes
User Properties
Field Name
Value
PDF
.*\.pdf$
jobDefinitionName
FAS430
XML
.*\.xml$
jobPackageName
/oracle/apps/ess/financials/assets/tracking/transfers
EXT_PortletContainerWebModule
Ledger
Since the standard report has the below parameter i have created same set of parameters for the Job which i have created, but i do not know how to assign the list of values to these parameters
Parameter Prompt
Data Type
Page Element
Default Value
Required
Book
String
Text box
Yes
Currency
String
Text box
Yes
Period
String
Text box
Yes
Batch
String
Text box
No
Step 4:-
Now when i navigate to schedule process, when i click Schedule New Process Button in the list of values i can see the job which i created. When i submit the job is completing with error.
When i open the xml file, file is blank and no data is available in the file.
When i open the log file i see the below error
dummy file is deleted
================ BIPJobExecutable Execution Started ============
OutputFile : /u01/APPLTOP/instance/ess/rfd/67068/out/67068.xml
Request ID: 67068 ClassLoader is weblogic.utils.classloaders.GenericClassLoader@1c85c3a finder: weblogic.utils.classloaders.CodeGenClassFinder@1c85cb3 annotation: FinancialsEssApp#V2.0@
RequestId:67068
ReportID : /Custom/Financials/Fixed Assets/Tracking/FLY FA Transfers Report.xdo
Process : BIPDocGen
The bipJobID : 6252
bipJobID is updated to ESSRuntimeService
BIP_STATUS_URL is added to ESSRuntimeService
================ BIPJobExecutable is running in async mode. ============
================ Please check the ess status for more detail info. ============
Am i doing anything wrong while creating the job?
Note :- I created another test data model and report with 'Select SYSDATE from dual' and am able to see the report completing successfully.
Please kindly help, i am failing to meet my deadlines.
Regards,
Prasad RHello Jani Rautiainen,
Thanks a lot for replying my question.
This is the first time i am working with the BI Publisher reports and fusion applications.
My requirement is to add few columns to the standard report with out loosing the functionality.
I was not aware that there is two ways of doing this, i was always copying data model and report to a new folder and trying to create a new job for the report.
As mentioned in the document 7.2.1.4 Using the Customize Feature , i clicked on the more button on my report but i do not see the customize option. Do i need to have any specific role for this to appear in the menu? Please kindly let me know.
Also i see below limitations while customizing report
Limitations
Following are limitations of the Customize report option:
The Customize option is only available through direct access to the BI Publisher server using the /xmlpserver URL (for example:http://hostname.com:7001/xmlpserver). The Customize option is not available through the /analytics URL used to access Oracle Business Intelligence Enterprise Edition.
The Customize option is available only for reports. The Customize option is not available for data models, style templates, or sub templates.To customize data models, style templates or sub templates and insulate them from potential changes from patching: Make a copy of the data model, style template, or sub-template and either rename it or place it in a custom folder. Ensure that you update any reports to point to the customized data model, style template, or sub template.
My requirement is to add few additional columns which needs Data Model to be modified, Can i copy the data model to the custom folder and do my modifications and point this data model in the report(as mentioned in the point 2 in the limitations)? In that case, will the original report submission works?
Regards,
Prasad R -
Need help with a basic script to resize image then resize the canvas
I am new to photoshop scripting, and have come across a need to force an image to be 8"x10" at 300dpi (whether it is vertical or horizontal)
I need to maintain the correct orientation in the file, so an Action will not work, I believe I have to implement a script to accomplish this.
I have the below script so far, but I am not certain of how to input the variables / paramters
doc = app.activeDocument;
if (doc.height > doc.width) doc.resizeImage("2400 pixels","3600 pixels", "300", "BICUBIC");
if (doc.height > doc.width) doc.resizeCanvas("2400 pixels","3000 pixels", "MIDDLECENTER");
if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
if (doc.height < doc.width) doc.resizeCanvas(3000,2400,"MIDDLECENTER");
When I run this script, I get the following error:
Error 1245: Illegal argument - argument 4
- Enumerated value expected
Line: 5
if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
The fact that its failing on lien 5 lets nme know that I have the "If" portions of my script correct, I just dont know how to accomplish the functions correctly.
Any help would be appreciated!
Thanks,
BrianI know I'm late here but it seems to me your trying to automate a 8"x10 or 10"x8 300DPI print.
To do that you must first crop your image to a 4:5 aspect ratio to prevent distortion unless your shooting with a 4" by 5" camera. I wrote a Plugin script a couple years ago that could help you do a centered crop. You could do the whole process by recording a simple Photoshop action that uses two Plugin Scripts only four steps would be needed.
Step 1 Menu File>Automate>AspectRatioSelection (My script based of Adobe Fit Image Plugin script) Set 4:5 Aspect ratio, center, Rectangle, Replace, no feather. Llike Fit Image this script woks on both Landscape and Portrait images. The Selection will be correct for the images orientation.
Step 2 Menu Image>Crop
Step 3 Menu File>Automate>Fit Image set 3000 PX height and 3000 PX width the Image will be Resample so its longest side will be 3000 pixels. Adobe Fit Image Plugin Script always uses BICUBIC resampling. I have a modified version of Fit Image that uses Bicubic Sharper whebndownsizing and BicubicSmoother when up sizing.
Step 4 Menu Image>Size un check resample set resolution to 300 DPI.
When you play the actions the Script Dialogs will not be displayed and the setting use when you recorded the action will ne used.
The Plugin Script are included in my crafting actions package:
http://www.mouseprints.net/old/dpr/JJMacksCraftingActions.zip
Contains:
Action Actions Palette Tips.txt
Action Creation Guidelines.txt
Action Dealing with Image Size.txt
Action Enhanced via Scripted Photoshop Functions.txt
CraftedActions.atn Sample Action set includes an example Watermarking action
Sample Actions.txt Photoshop CraftedActions set saved as a text file. This file has some additional comments I inserted describing how the actions work.
12 Scripts for actions
My other free Photoshop downloads cam be found here: http://www.mouseprints.net/Photoshop.html
Maybe you are looking for
-
ITunes moved to a new hard drive, now acting like a newly installed program
I just moved my ITunes to an external hard drive and followed all the directions to do so (did a google search and it lead me to this site where I followed the instructions outlined). Now ITunes won't work, it won't access any music whatsoever. In fa
-
Want to replace my hard drive from 160g to 500g what do i need to know
want to replace my hard drive on a compaq presario sr055cl. it has a 160 g hard drive how big can i go This question was solved. View Solution.
-
Tooooooo much to comprehend. Please help. I have a very simple question !!
Hi All Gurus, I have been to almost all sites that google could throw at me, also scanned a lot of books, but thats just added to confusion. Thus, resorting to the root of all, the oracle forum. Please review the task & suggest a solution, even a goo
-
Tomcat 4.0.1 & Apache 1.3.22 & mod_webapp & virtual hosts
I have succesfully been able to get tomcat 4.0.1 and apache 1.3.22 to use mod_webapp in both linux and windows. First problem: If I don't include a trailing slash, my webapp will not display. Just a 404. mod_dir works on the apache end. Also if I acc
-
Is there a version of Safari for WINDOWS later than 5.7?
I have a Dell XPS 1 which on which I run Windows 7. I have always used Safari as my OS. I am receiving emails which indicate that my version of Safari 5.7 is no longer supported by gmail. I can't find any version of Safari later than 5.7 which is for