Welcome Guest, Not a member yet? Register   Sign In
Onclick does nothing
#11

Also tried:

<script>
function add_row_js() { <?=site_url('download_page/add_row')?> }
</script>
<a href="http://www.downloaddocs/file.doc" onclick="add_row_js();">

which does download the file, but doesn't call the add_row() in the Controller class to run a query.
Could be the main developer doesn't want me to work on his site and has set it up so function calls will never work on the page I was assigned to </sad face>.
Reply
#12

Deborah, I recommend and going back and doing some tutorials on html, javascript, and php. Everything you've shown here indicates that if coded correctly, your function would work just fine.

The html you're using above won't work because it's not being written correctly. I'd recommend something like https://www.w3schools.com/html/ to get started.

The javascript you posted above is still incorrect and doesn't do anything. I'd recommend getting started with https://www.learn-js.org/ to get the basics of javascript.

For your php and back end, there are hundreds of resources, but I'd recommend some youtube videos that have some visuals to depict the difference between backend and frontend.

I'd slow down the roll on trying to blame the 'main developer' until you've written working code that is not working, but for the time being, it's just code that won't work in any environment.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#13

Wonder why Albert has repeated the same thing 3 times, "my code is wrong and need to learn how to code", which useful in the long-term but useless for my boss who has waited 6 days for me to write 1 line of code that updates a table. Sounds a bit trollish to provoke an argument, anyways thanks for the helpful comments guys, I'm off to StackOverflow where fingers-crossed I might get some code examples I can work backwards from.
Reply
#14

I agree with albertleao going back and doing some tutorials on HTML, javascript, and PHP. I am also learning some coding difficulty and follow one of the online programming community.
For javascript resource check this - https://hackr.io/tutorials/learn-javascript
Reply
#15

I also suggest learning JS. Here is a simple game for learning JS very quickly: https://myhsts.org/tutorial-build-guess-...script.php
Reply
#16

(This post was last modified: 07-10-2021, 05:22 AM by justiceankomah. Edit Reason: You can post a relevant article but don’t just spam the forum with a general blog on a 2 year old post! )

I understand your point but I think that must be a javascript error. Is not a server error, so check your DOM element. I wrote about how the DOM element interacts with the server in my coding tutorials blog https://tutorialscamp.com/
Reply
#17

w3schools - jQuery Tutorial
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply




Theme © iAndrew 2016 - Forum software by © MyBB