Jump to content

Chrex

Members
  • Posts

    38
  • Joined

  • Last visited

Posts posted by Chrex

  1. But how can I set a link behind the button?

     

     

    Putting the href in the button doesnt work:

    <button class="123" href="abc.html">abc</button>

    Putting the button-class in the link doesnt work too:

    <a class="button" href="abc.html">abc</a>
  2. Hi there,

     

    can you just use a button to "submit" and "delete" something? Im planing to have a "link"-button.

    Is there a tutorial for buttons? I want to learn how to create and design buttons. :)

     

    Thanks for your help,

    Chrex

  3. Got it :)

    <?php$csv = array();$file = fopen('myfile.csv', 'r');while (($result = fgetcsv($file)) !== false){    $csv[] = $result;}/*******************************************/$i="0";for ($c=0; $csv[$c][0] =< $postalcode; $c++){$i=$i+1;       }$postalcoderow = $i;/*******************************************/fclose($file);/*echo '<pre>';print_r($csv[$postalcoderow][$columnnumber]);echo '</pre>';*/?> 
  4. Hi guys,

     

    here is what I have:

     

    • an excel sheet (XLS, 4MB) with postal codes in the first column
    • more data in the other columns

     

    here is what I need:

     

    • looking for the postal code in the excel sheet
    • get the information to this postal code from the other columns
    • work with the other information (use them as variables)

     

    example:

     

    PC | A | B | C

    1234 | 2.3 | 3.5 | 1.1

    2345 | 3.3 | 3.3 | 7.8

     

    ---> If I have the postal code 2345, I want to create the variables $a=3.3 ; $b=3.3 ; c=7.8 in PHP

     

     

    here is what I heard about:

     

    • phpexcel.php
    • php_excelReader

    here are my questions:

     

    What would you recommend (phpexcel.php or php_excelReder or something else)?

     

    Is there a tutorial on w3schools (I couldn´t find one)?

     

    Can you provide some code?

     

     

    Thanks for your help!

     

     

  5. Thanks to everyone again, especially to Ingolme (he delivered the solution).

     

    The formate of the script was ANSI, so I had to change it with "Encode in UTF-8". No idea why it didn´t work right away after clicking on "Encode in UTF-8", but after a few conversions (ANSI, Encode in UTF-8, Concert to UTF-8) it works. You can´t do this with Expression Web 4, I used Notepad++. Hope it will help someone with the same problem.

     

    Cheers,

    Chrex

  6. hmmm,

     

    my page works with UTF-08:

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

    ...and my script too:

    <script type="text/javascript" charset="UTF-8" src="show.js">

    Everything works, when I replace "m³" with "m".

    How I said, I had the same problem with "ä, ö, ü", but I could solve it by using "u00f6". But u33a5" doesn´t work for "m³".

  7. @Jonathanks: I tryed this "<sup>3</sup>" already...it doesnt work.

     

    @Ingolme: The variable is set in front of the "if-code", right after the start of the function.

    function show_selection(){var abc = document.getElementById('abc').value;	if (abc == "m³") {		var variable = "m³";		document.getElementById('show').innerHTML = variable;	}}
  8. The problem has to be the "if-code". The "if" doesn´t agree that abc == "m³".

    I figured that out by changing the code to:

    if (abc == "m³") {	var variable = "m";	document.getElementById('show').innerHTML = variable;}

    If the "if-code" would work, I would get "m".

     

    I´m very sure the innerHTML works, because it does work with all the other variables.

  9. @Foxy Mod: That doesn´t work for me. I also use the value in php and it will be shown at one place, so it needs to be "m³".

     

    @justsomeguy: "doesn´t work" means, my script/function doesn´t work with the value and doesn´t show the value.

     

    I had the same problem with "ä" and I could solve it by replacing the "ä" with "u00e4". I thought there is something like that for "m^3".

  10. Hi guys,

     

    I need to work with "m³". The function in my script gets a value from a selection. I have 10 seletion options. It works fine with 9 of them, just the "m³" doesnt work. I read something about unicode, but couldn´t find the right one (if it exist für ^3). I also had a look at the w3 js pages (number, math), but that didn´t help too.

    if (abc == "m³") {	var variable = "m³";	document.getElementById('show').innerHTML = variable;}

    Thanks for your hints,

    Chrex

  11. Hey guys,

     

    It finally works :)I found the following code here:

    http://codingforums.com/dom-json-scripting/247911-javascript-onchange-event-select-tag.html

    No idea why the other code didnt work, but here is the (for me) working one:

        <script type="text/javascript">		function show_selection_value(){		var value = document.getElementById('ID-of-my-select-box').value;		document.getElementById('target').innerHTML = value;		}	</script>	<div id="target"></div>

    Thanks again for all your help!

  12. I did read your post, otherwise I wouldnt have looked for "onchange". I tried to work with your suggestions and your code (last 2 days), but it didn´t work. I don´t want to say that you provided something wrong, I´m probably just to new to JS to understand how to use it propperly. I´m "just" an engineer, not a programmer.

     

    Still don´t understand why the script, which I posted, doesn´t show me the selected element. It works so nice on the website where I found it.

  13. Thanks for your help again! "onchange" is what I was looking for. I found the following code. Do you think thats correct? The script doesnt show me the selected element :/

     

    Source: http://www.mediaevent.de/javascript/onchange.html

    <select id="sel">   <option value="Stiefmütterchen">Stiefmütterchen</option>   <option value="Primeln">Primeln</option>   <option value="Tulpen">Tulpen</option></select><script type="text/javascript">   var sel = document.getElementById('sel');   sel.onchange = function() {      var show = document.getElementById('show');      show.innerHTML = this.value;   }</script>
  14. Thanks for your reply.

     

    I´m using "select" in my code, that was just a typing mistake. If I´m right, you use name="" for PHP and id="" for JS?! Why doesnt the following work: clicking on a selection and the JS (which is below the selection) is using the selection variable? Isn´t there a way to say:"hey, you are my JS variable, be used in the next JS."?

  15. Hi guys,

     

    I use a very big form and my variables will be saved in a session. In most cases I´m fine with PHP. Until now I just use JS to hide and show some options.

     

    My idea is to give the user a selection (somewhere in my form). As soon as the user clicks on one of the selection options, the value of the variable shall appear as text below the selection options (not just in the selection options).

     

     

     

    1. Idea - import the php-variables in my JS and work with it

    <script type="text/javascript">var test ="<?php echo $test ?>";</script>

    --> didnt work. I could work with the variable, but I dont get a "fresh" variable from the session, because I would have to push the form button first.

     

     

     

     

     

    2. Idea - create a JS variable in the selection options

    <selection id="test"><option value=test1">Test1</option><option value=test2">Test2</option>...</selection>

    --> didnt work.

     

     

    Do you have any ideas what I should look for or what I have to do?

     

    Thanks and cheers,

    Chrex

×
×
  • Create New...