JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Dec 5, 2022 11:53
Hi :)
Dec 5, 2022 11:53
i asked the same here
https://www.reddit.com/r/learnjavascript/comments/zczo0b/js_function_with_multiple_raw_id/
if anyone could help on this , i appreciate :)
Dec 5, 2022 10:09
It is not working and I know I missed up in JS code, I tried different ideas but non worked for me
I appreciate any help on this
Thanks
Dec 5, 2022 10:09
function myFunctionpass() {
var x = document.getElementById(id);
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
Dec 5, 2022 10:08
and for the function I used:
Dec 5, 2022 10:07
echo "<td><input type='password' id=" . $row['ID'] . " value=".$row['GUI_Pass']."><input type='checkbox' onclick='myFunctionpass(this.id)'></td>";
Dec 5, 2022 10:07
I'm trying to hide the password in each raw, and only only by clicking on checkbox the password should be displayed.
The thing is that I'm using table and each raw should have unique ID
So I thought about putting the $row['ID'] as an id for each raw and then passing it to the function:
Feb 6, 2022 14:30
But thanks for your help :)
Feb 6, 2022 14:29
using the function in onsubmit instead of onclick
Feb 6, 2022 14:29
0
Q: Disable button on click but cannot pass parameter to controller

elszeusI have a button, which when clicked I want to disable. <input type="submit" value="Save" class="btn btn-default" name="submit" style="float: right; position: relative; right: -18px;" /> The value "Save" needs to pass from the button to the controller: public ActionResult EditCall(ModelCall...

Feb 6, 2022 14:29
using this
Feb 6, 2022 14:29
@SebastianSimon I managed to make this work
Feb 6, 2022 13:47
Then it stops to pass the value "fav_HTML"
Feb 6, 2022 13:47
<!DOCTYPE html>
<html>
<body>

<h1>The button value attribute</h1>

<form action="/action_page.php" method="get">
Choose your favorite subject:
<button name="subject" id=btnSubmit_6 type="submit" value="fav_HTML" onclick="disableButton()">HTML</button>
<button name="subject" type="submit" value="fav_CSS">CSS</button>
</form>
<script>
    function disableButton() {
        var btnSubmit_6 = document.getElementById('btnSubmit_6');
        btnSubmit_6.disabled = true
    }
</script>
</body>
</html>
Feb 6, 2022 13:46
So if I edit the code to this :
Feb 6, 2022 13:45
@SebastianSimon Let assume it is like this example
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_button_value2
Feb 6, 2022 13:07
<input id="btnSubmit_6" type="submit" value="<% signin %>" name="btnSubmit" onclick="disableButton()">&nbsp;
Feb 6, 2022 13:06
but it is not passing the value
Feb 6, 2022 13:06
    <script>
    function disableButton() {
        var btnSubmit_6 = document.getElementById('btnSubmit_6');
        btnSubmit_6.disabled = true
    }
</script>
Feb 6, 2022 13:04
Hi
a quick question :)
 

Trash can

Like the recycle bin, but trashier.
Dec 5, 2022 10:08
function myFunctionpass() {
var x = document.getElementById(id);
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
Dec 5, 2022 10:08
and for the function I used:

function myFunctionpass() {

var x = document.getElementById(id);

if (x.type === "password") {

x.type = "text";

} else {

x.type = "password";

}

}
Feb 6, 2022 13:05
im using this javascript to disable button after once clicking on it

<script>
function disableButton() {
var btnSubmit_6 = document.getElementById('btnSubmit_6');
btnSubmit_6.disabled = true
}
</script>
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Dec 4, 2022 07:48
this is the function:

function pop_up(url){
window.open(url,'win2','status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=1076,height=768,directories=no,location=no')
}
Dec 4, 2022 07:47
echo "<td><a href='/cloudpass/viewpass.php?id=".$row['ID']."' class='btn btn-warning btn-sm' onclick='pop_up(this)'>View Password</a></td>";
Dec 4, 2022 07:47
hello guys, I'm trying to open a popup instead of new tab
the popup works, but my code still open new tab along with the popup
is there something wrong here?
Jul 5, 2022 11:50
any idea ? :)
Jul 5, 2022 11:50
Server Error in '/' Application.
Access is denied.
Jul 5, 2022 11:50
guys, i just upgraded the phpmyadmin from 4.7.4 to 4.9.10, everything works fine in the website towards the database, but im unable to access the webui localhost/phpmyadmin
Jun 12, 2022 15:42
but when i used the fwrite , it wrote nothign , empty output
Jun 12, 2022 15:41
0
Q: PHP Cron Script - read from from CSV file and email (UTF-8?)

user2295798I am struggling with this issue for few days now, reading and trying whatever I came across with no solution found: Here is the bottom line of what I want to do: I have a members only system. when a member posts a message on the message board all others get notification by email. Simple. I use th...

Jun 12, 2022 15:41
someone says here that we should use the fwrite instead on fputcsv
Jun 12, 2022 15:41
i tried also the utf8_encode , but no luck ...
Jun 12, 2022 15:41
my database in indeed encoded as utf-8
Jun 12, 2022 14:41
I wrote a php code to export data to CSV file
but data exported that includes Hebrew characters are showing as gibberish
Here is my code
https://pastebin.com/D7e492Hv
And here is how it is showing after being exported
https://ibb.co/jzSpqmJ
Jun 12, 2022 14:40
in my case it is hebrew charecters
Jun 12, 2022 14:40
hello guys
can anyone tell me how to solve exporting data to csv file when the file has special cherecters ?
Dec 21, 2021 07:37
echo "<pre>" . fread($myfile,filesize($filetxt)) . "</pre>";
Dec 21, 2021 07:37
this was the solution
Dec 21, 2021 07:37
ok , solved
Dec 21, 2021 07:10
i meant , For some reason, it's writing \n as a string
Dec 21, 2021 07:09
sure , why not :P
Dec 21, 2021 07:06
like where you should i use diametter
Dec 21, 2021 07:05
my txt file is about ip addresess, like this :
10.1.1.1
10.2.2.2
10.3.3.3
and php displaying all in one line like this:
10.1.1.1 10.2.2.2 10.3.3.3 ...
Dec 21, 2021 07:05
like, how should i make new lines , like \r ?
Dec 21, 2021 07:04
but if my txt file has new lines , why then php is displaying all in one line ?
Dec 21, 2021 07:04
thank you tiffany
that indeed helped
Dec 21, 2021 06:50
if i try to set it like this:
$myfile = fopen("myfile.txt", "r") or die("Unable to open file!");
then i got error message "Unable to open file"
Dec 21, 2021 06:50
i think im passing the file path
Dec 21, 2021 06:49
$myfile = fopen("C:\inetpub\wwwroot\...\myfile.txt", "r") or die("Unable to open file!");
$minSize = 5 * 1000; // 5KB
$fileExist = is_file($myfile);
if (!$fileExist || ($fileExist && filesize($myfile) < $minSize)) {
echo fread($myfile,filesize("myfile.txt"));
fclose($myfile);
}