Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
have tried giving to target it by using  a spanking tag. To calling  it but Its not working I suspected I wrote a wrong code


What I have tried:

I have tried giving to target it by using a spanking tag. To calling it but Its not working I suspected I wrote a wrong code
Posted
Updated 19-May-20 1:17am
Comments
Richard Deeming 19-May-20 8:20am    
A "spanking" tag? I really don't think you mean to use that word. 🤣

1 solution

If you want a javaScript to use the data on your page, form or not, you need to call the javascript function from your page. When you do a "SUBMIT" of the form you're going back to the server with the form data (those that have name='something' attribute). On the server side I personally prefer giving it to php. This will render a new page with whatever content you have built into it.


On your page, you need an "onclick" event and a target file which will be your javascript function. All of the data on the page is accessible. To learn how to do this you need to access the desired data, in general, via DOM. This can be learned about (easy tutorial) here.[^]



 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900