Change php variable with javascript??

Hey Guys
I need to know how can i send the form to a different email address if someone selects an option from the "BSU(area)" on the HTML from.
So basically if the are on the html form and they select NewCastle from the "BSU(area)" for example i want the script to change the email address to the address assigned to that option.
How can i achieve this? If you guys need to see my PHP script let me know.
Help please!!
Here's the link: http://flyingant.co.za/invite.html
yours
Ashveer

Yes i agree with you.
Here's my script tell me where i am going wrong?
<?php
// Build message.
$my_email = "";
global $my_email;
function build_message($request_input){if(!isset($message_output)){$message_output ="";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!empty($value)){if(!is_numeric($key)){$message_output .= str_replace("_"," ",ucfirst($key)).": ".build_message($value).PHP_EOL.PHP_EOL;}else{$message_output .= build_message($value).", ";}}}}return rtrim($message_output,", ");}
$message = build_message($_REQUEST);
$message = $message . PHP_EOL.PHP_EOL."-- ".PHP_EOL."";
$message = stripslashes($message);
$subject = "Form To Email Comments";
$headers = "From: " . $_REQUEST['Email'];
mail($my_email,$subject,$message,$headers);
?>
<?php
function getValue($Result){
//$Item = form.BSUarea.selectedIndex;
$Item = $_POST["BSUarea"];
//$Result = form.BSUarea.options[Item].text;
$Result = $_POST["BSUarea"];
switch ($Result) {
case ($Result = "Gauteng"):
//$Gauteng = "[email protected]";
$my_email = "[email protected]";
//$my_email = $Gauteng;
break;
/*case ($Result = CapeTown):
CapeTown = "[email protected]";
$my_email = CapeTown;
break;
case ($Result = Richards_Bay):
Richards_Bay = "[email protected]";
$my_email = Richards_Bay;
break;
case ($Result = Pinetown):
Pinetown = "[email protected]";
$my_email = Pinetown;
break;
case ($Result = Pietermaritzburg):
Pietermaritzburg = "[email protected]";
$my_email = Pietermaritzburg;
break;
case ($Result = NewCastle):
New Castle = "[email protected]";
$my_email = NewCastle;
break;
case ($Result = George):
George = "[email protected]";
$my_email = George;
break;*/
?>
<!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=utf-8" />
<title>BSU - Evite</title>
</head>
<body>
<div class="main">
<div class="content"></div>
<form id="form1" name="myform" method="post" action="#build_message">
<table width="525" border="0">
<tr>
<td width="270"><label><strong>BSU(area)</strong></label></td>
<td width="10"> </td>
<td width="240" align="left">
<select name="BSUarea" id="BSUarea" onchange="getValue($Result)">
<option value="Durban">Durban</option>
<option value="Richards_Bay">Richards Bay</option>
<option value="Gauteng">Gauteng</option>
<option value="CapeTown">Cape Town</option>
<option value="George">George</option>
<option value="NewCastle" >NewCastle</option>
<option value="Pietermaritzburg" >Pietermaritzburg</option>
<option value="Pinetown">Pinetown</option>
<option value="Polokwane">Polokwane</option>
</select></td>
</tr>
<td width="270"></td>
<td width="10"> </td>
<td width="240"><label>
<input type="reset" name="Reset" id="Reset" value="Reset" />
<input type="submit" id="Submit" value="Submit" />
</label></td>
</tr>
</table>
</form>
</div>
</body>
</html>

Similar Messages

  • Change "choiseListe" values with javascript

    Dear,
    Is it possible to change "choiseListe"  values  with javascript.
    Exemple il have a choseListe :
         Country //// Values
          USA            us
          France         fr
          Spain           sp
    When il click in a botton i whant to change this choceListe :
         Country //// Values
          Morocco           ma
         Portugal           pt
    Thanks

    Hi,
    Listboxes and dropdowns can be scripted against without too much difficulty.
    You would need something like this in the click event of the button:
    listbox1.rawValue = null; //clear previous choice
    listbox1.clearItems(); //clear the list items
    listbox1.addItem("Moocco", "ma"); //add new list items
    listbox1.additem("Portugal", "pt");
    Hope that helps,
    Niall

  • Change 3D views with JavaScript code?

    I am looking for a way to change 3D views using JavaScript. I want to obtain similar result as the predefine action (Go to a 3D view) but with code.
    More preciselly, I want to connect items within a list box to different 3D views.
    Any ideas or suggestion would be greatly appreciated.
    Thank you
    Tutorial on how to use the Go to a 3D view action:
    Connecting Document JavaScript to 3D Views (PDF: 2.3M)
    http://partners.adobe.com/public/developer/en/tips/topic_tip3.pdf
    Related topics:
    looking for a way to switch views using Javascript
    http://www.adobeforums.com/cgi-bin/webx/.3bbed722/0
    SMOOTH TRANSITION BETWEEN VIEWS?
    http://www.adobeforums.com/cgi-bin/webx/.3bc0ce56
    Cameras vs. views; views.xml
    http://www.adobeforums.com/cgi-bin/webx/.3bbf0748/3

    hello maybe other have same problem i found a simple solution for me
    use the javascript bridge and juse the f4m manifest files
    function changeSrc(playerdivId,src){
                var player = document.getElementById(playerdivId);
                player.setMediaResourceURL(src);
    src multicast fm4 manifest like this
    http://sourceforge.net/apps/mediawiki/osmf.adobe/index.php?title=Flash_Media_Manifest_(F4M )_File_Format
    best regards

  • Change page attribute with JavaScript

    Hi,
    hope someone can help.
    Is it possible to change a BSP page attribute with JavaScript??
    I have a JavaScript array with some serialnumbers. After push a save button, i want to save the array data into a page attribute.
    Some ideas?
    Regards Anton

    Hi,
    The only way of passing vars from JS to page attributes is submitting them via (hidden) values in a form or via params in an URL.
    Alternatively, you can try to let JS store things in a client cookie and let the BSP read that cookie.
    I didn't try that out yet though.
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • Change TextView value with Javascript

    Hello,
    I'm trying to find a way of changing the value of an HTMLB TextView on the client side with javascript.
    Do you know how to do that ? Cannot work it out...
    Many thanks
    Nicolas

    Hi,
    this can be a bit tricky, because you have to know, how to access the element. that means you need an unique id or an absolute position of the TextView-element
    if you can see, how to access the specific element in your client-pagesource, a possible javascript could be:
    document.getElementById("<id of element>").firstChild.nodeValue="My new Text"
    or access by name/count of the element:
    document.getElementsByName("<name of element>")[#position of occurance].firstChild.nodeValue="My new Text"
    kr, achim

  • Changing applet parameters with Javascript

    Is it possible to have an applet read a param value which has been changed with Javascript after the applet loads?
    I've tried changing the param value in this way, but the applet doesn't read the new value. It reads the default value in the HTML when the applet loads, and getParameter is in the main loop of the applet which runs and updates other (internal) values fine...

    Well that page says that param values can't be changed at run-time. Never mind though because I read some more and found out how to implement a method in the applet (which can be called from Javascript) that reads the host page's DOM, thereby achieving the same result.
    Thanks for the pointer.

  • Change SSIS variable with reference in C# ?

    I access a read write variable with C# in script task. Its Dts.Variables["strRope"].Value = "onFire";
    Is there any way I could refer to a SSIS variable without using this big name ? I was thinking of  - 
    Object var = Dts.Variables["strRope"].REFERENCE_TO_VARIABLE;
    Now, if I want to reassign strRope, I can simply say var = (String) "Ten thousand thundering typhoons".
    Is there any way I can do such a thing ?
    I tried this -
    public void Main()
    object var = Dts.Variables["strRope"].Value;
    MessageBox.Show("original value = " + Dts.Variables["strRope"].Value.ToString());//original value = "Hello World"
    //Try to change the value of Dts.Variables["strRope"].Value using var ???
    var = (object)"Hello cruel world !";
    MessageBox.Show("new value = " + Dts.Variables["strRope"].Value.ToString());//new value = ???
    Dts.TaskResult = (int)ScriptResults.Success;

    You cant. you need to invoke it using Dts.Variables collection itself.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    I think it would be useful to have this feature. So one can create aliases for all the long SSIS variables in the beginning of the code itself. Otherwise, one has to put it all around. 
    I was trying this - 
    public void Main()
    object var = Dts.Variables["strRope"].Value;
    MessageBox.Show("original value = " + Dts.Variables["strRope"].Value.ToString());//original value = "Hello World"
    //Try to change the value of Dts.Variables["strRope"].Value using var ???
    var = (object)"Hello cruel world !";
    MessageBox.Show("new value = " + Dts.Variables["strRope"].Value.ToString());//new value = ???
    Dts.TaskResult = (int)ScriptResults.Success;

  • [SOLVED] Change environment variables with Shell scripts

    How can I change the "BROWSER" environment variable with a shell script; so I can change it on the fly?
    Last edited by oldtimeyjunk (2012-10-31 12:57:42)

    If you just want to do it for BROWSER so that you can change your default web browser on the fly, you could set BROWSER to e.g. ~/bin/mybrowser and create a symlink to the browser you want at ~/bin/mybrowser. Then you could change the symlink at will.
    EDIT: man xdg-settings
    Last edited by cfr (2012-10-31 02:20:16)

  • Dynamically change flex variables with JSON

    I am trying to take different variables from within each other, and use that to dynamically change variables within flex, and I am not sure how to write it. For example, the JSON code would be something like:
         "content" : [
                                  "panels" : [
                                                           "height" : "200",
                                                           "width" : "300"
    Now I am trying to take the height and width from that, into flex, and change the panels' dimensions. any ideas?

    DSpider wrote:
    https://wiki.archlinux.org/index.php/Be … oxy_server
    Speed differences could be because the company is throttling certain connections (some companies do this, to discourage Youtube, FarmVille and other distractions). Hmmm... But a 10% difference is probably something else. Maybe check your /etc/resolv.conf?
    This is actually concerning my other thread . But in answer, no, same resolv.conf used in both cases. As I said there, I simply export a different value in http_proxy (no reconnection of any sort) and speed suddenly jumps.
    DSpider wrote:
    Edit: And maybe see this: http://askubuntu.com/questions/3554/how … connect-to
    And this: http://marin.jb.free.fr/proxydriver/
    Just about all of those things I've mentioned above as tried, except the .pac file. The problem with that is that it doesn't work generally for all graphical applications, just ones that understand it (like firefox, I believe chromium as well) while things like dropbox would not work.
    Proxydriver seems very much gnome/kde linked, which isn't of much help when I'm running awesomewm.
    Thanks for your answers, really, but still looking for something else. Latest idea I have is to replace dropboxd, firefox, and all the other executables with my own script which first sets up http_proxy and then runs the original executable. So something like this:-
    #!/bin/sh
    export http_proxy=`cat /path/to/the/desired/proxy/server/as/set/up/by/netcfg/hooks`
    /usr/bin/firefox &
    Any disadvantages to this method? Then I can just forget about using tinyproxy (wouldn't mind that at all, its been a pain sometimes, just dying in the middle of a big transfer). I could possibly also do away with the netcfg hook and just implement the checking logic (based on the IP range) in the bash script itself.

  • Change rtmfp groupspec with javascript

    hello
    is it possible to change dynamically the groupspec and play the new rtmfp group?
    test code
      var parameters =
                            {       src: "rtmfp://p2p.rtmfp.com/2924a8afa44eaff4aac318fe5b39248d277688d663c6dfb422e6e9663967d39b/"
                            ,       autoPlay: true
                            ,       groupspec: "G:0101010c040e6f747200"
                            ,       multicastStreamName: "stream"
                            ,       streamType: "live"
                            ,       streamName: "stream"
                            ,       controlBarAutoHide: false
                            ,   javascriptCallbackFunction: "onJavaScriptBridgeCreated"
                    // Embed the player SWF:
                    swfobject.embedSWF
                            ( "StrobeMediaPlayback.swf"
                            , "strobeMediaPlayback"
                            , 640
                            , 480
                            , "10.1.0"
                            , parameters
                            , { allowFullScreen: "true"}
                            , { name: "strobeMediaPlayback" }
    var player = null;
                    function onJavaScriptBridgeCreated(playerId)
                            if (player == null) {
                                    player = document.getElementById(playerId);
                                    document.getElementById("newchannelgroup").onclick = function(){
                                                   //HERE SET NEW groupspec and play the rtmfp
                                                    player.play2();

    hello maybe other have same problem i found a simple solution for me
    use the javascript bridge and juse the f4m manifest files
    function changeSrc(playerdivId,src){
                var player = document.getElementById(playerdivId);
                player.setMediaResourceURL(src);
    src multicast fm4 manifest like this
    http://sourceforge.net/apps/mediawiki/osmf.adobe/index.php?title=Flash_Media_Manifest_(F4M )_File_Format
    best regards

  • Change Browser Language with Javascript

    Hey
    I need to change the language of the user in the portal , using two small links , EN | PT  if the user clicks EN the browser language will be EN_US else pt_PT how can i do something like this?
    i'm looking for javascript solution mainly or anything else related to sap. thanks

    Hi,
    String user = null;
         try {
          user =
           WDClientUser
            .getCurrentUser()
            .getSAPUser()
            .getUniqueName();
         } catch (WDUMException e) {
          // fpm.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), e);
    try{
    wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("user"+user);
    IUserFactory userfact = UMFactory.getUserFactory();
    IUserMaint userMaint = userfact.getMutableUser(user);
    userMaint.setLocale(Locale.FRENCH);
    userMaint.commit();
    wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("success");
    }catch(Exception e){
    Hope this code helps you.
    Cheers-
    Pramod

  • Changing Global Spot with Javascript

    Hello,<br /><br />I'm trying to update a swatch (global, spot) that is linked to a path object, say, a rectangle.<br /><br />In Illustrator, if I double-click the swatch, change the CMYK values and click ok, the path object fill colour updates to the new swatch colour.<br /><br />I want to replicate this with script.<br /><br />So far I have written:<br /><br />if (app.documents.length > 0){<br />     var swatches = app.activeDocument.swatches;<br />     for(i=0;i<swatches.length;i++){<br />          var currSwatch = swatches[i];<br />          if(currSwatch.name == "Prim1"){<br />               var newColor = new CMYKColor();<br />               newColor.cyan = 35;<br />               newColor.magenta = 0;<br />               newColor.yellow = 50;<br />               newColor.black = 0;<br />               currSwatch.color = newColor;<br />          }<br />     }<br />}<br /><br />Which updates my swatch "Prim1" and changes the colour as it's supposed to.<br /><br />However.<br /><br />The link to the object is lost, and the swatch is no longer global. Basically, it updates the swatch, and not the object (that's bound to it by its original global setup).<br /><br />Am I missing a line that tells my swatch to keep its global property?

    Just in case you haven't gotten a reply<br /><br />Try<br /><br />if (app.documents.length > 0){<br />var swatches = app.activeDocument.spots;<br />for(i=0;i<swatches.length;i++){ var currSwatch = swatches[i]; if(currSwatch.name == "Prim1"){ var newColor = new CMYKColor(); newColor.cyan = 35; newColor.magenta = 0; newColor.yellow = 50; newColor.black = 0; currSwatch.color = newColor; } } }<br /><br />I would like to change the name also - Any ideas?<br /><br />Good Luck<br /><br />Nick

  • I load a PHP variable with Loadvar and...

    Though I described my problem... I am importing a PHP var, it
    loads perfectly the first time, but then it keeps the same value
    and I need to load the new value each time I go the page contains
    the code..... any suggestion please ? It is very urgent, thanks in
    advance,

    The thing is you'll need to refresh your cache so that it
    reads the updated valur of your php value. There is a quick work
    around / hack to this:
    Whenever you load your php script just add a simple time
    based extra value to it, it won't change the way the script works,
    but it'll make the movie think its loading a different file
    everytime, so ther won't be any mistake:
    var d:Date=new Date();
    LoadVarsObject.load('file.php'+d.getTime());
    Cheers,
    Gorka
    www.AquiGorka.com

  • Updating Flash Variables with JavaScript

    I am looking to update a Flash Variable that I created in my Xcelsius Component by using JavaScript.
    I would like to know if this is possible and if so an example would be great.
    Thanks in advance

    Hi Christopher,
    This is possible.  To get a brief idea of what FlashVars look like in the HTML:
    1) In Xcelsius, add a FlashVar connection and bind it to a range
    2) Export your project to HTML
    3) Open the HTML in notepad and notice the FlashVar properties in the Object and Embed tags.
    Basically your JavaScript  will control the variable that go into your FlashVar parameters. I have attached a basic example for you.
    In this example, the value input updates the flash variable which is linked to the gauge component.
    Best regards,
    Jon Teopaco

  • Is there any way to get windows environment variables like %USERNAME% with javascript?

    is there any way to get windows environment variables like %USERNAME% with javascript using Adobe 10 pro?

    There is a fair amount of Acrobat JavaScript and Acrobat knowledge need to sort all of this out.
    The identity object holds a lot of sedative information. First, upon installation of Acrobat, only the login name is available in the identity object and the end user of the application needs to complete the "Name", "email" and "Organization Name" in the application's preferences. These are the only fields that are available to Acrobat JavaScript identity object as corporation, email, loginName, and name.
    Using the instructions in The Acrobat JavaScript Console (Your best friend for developing Acrobat JavaScript) you can run the following script in the JS console to see the items of the identity object:
    for(i in identity) {
    console.println(i +": " + identity[i]);
    and the following will appear in the console:
    loginName: georgeK
    name: George Kaiser
    corporation: Example
    email: [email protected]
    true
    The documentation states you need to use a trusted function to access this data, but you can access it at startup of Acrobat/Reader and add the properties of the identity object to an array:
    // application variable to hold the properties of the identity object
    var MyIdentity = new Array();
    // loop through the properties of the identity object
    for (i in identity) {
    // place each property of the identity object into an element of the same name in the Identity array
    MyIdentity[i] = identity[i];
    console.println(i +": " + MyIdentity[i])
    You access the items with:
    var loginUser = MyIdentity[loginName];  // get the loginName property
    In the user application level JavaScript file. See Acrobat Help / User JavaScript Changes for 10.1.1 (Acrobat | Reader) for the location of the application level folder you need to use.
    I would change the name of the array used in this post so an untrusted user cannot get to your data. Some of this data can be used in hacking into a user's system.

Maybe you are looking for

  • ADOBE CREATIVE CLOUD CLEANER TOOL

    ADOBE CREATIVE CLOUD CLEANER TOOL  で削除したいのですが 削除する製品がないと表示されますが?どうすればいいでしょうか?イラストレーターcs4/5を削除したいのですが 起動しない為

  • Sap m select not showing all values from gateway

    Hello Experts, This is the code for my select: var SelectCondType = new sap.m.Select("SelectCondType", {    width : "200px"    var oItemSelectTemplate1 = new sap.ui.core.Item({               key : "{ID}",               text : "{Name}"    var sService

  • How to delete entries in COSP table?

    Dear experts How to delete the transactions posted in COSP table from my testing client. The reason is user has created wrong cost element and posted the transactions. But they don't want this as cost element. I have deleted entries in COEP table by

  • Table and fields for " Batch Code Date " and "Shelf Life days".

    Hi All, What is the field for " Batch Code Date " and "Shelf Life days". And in which table are they present. Thanks & Regards, Ahmed.

  • How to view presentation outline in Keynote 09 for iPad?

    Keynote'09 for osx has a outline option in the view menu. Is there such option in keynote for iPad? If not where can I ask this feature? - hopefully for a future patch/update.