I am trying to design a webpage that contains multiple buttons. These buttons are not submit or cancel buttons, but rather buttons that I would like to tie specific actions to in the MyDoPost() routine. Could you help me determine how to accomplish this?
HTML Page Code Snippet:
------------------------------
<p>
<button name="B1">1</button>
<button name="B2">2</button>
<button name="B3">3</button>
</p>
NetBurner Code Snippet:
-----------------------------
int MyDoPost(int sock, char *url, char *pData1, char *rxBuffer)
{
//Determine which page issued the submit and process accordingly
sprintf(buffer, "%s", url);
if(strncmp(buffer, "/INDEX.htm", 9)=0)
{
}
}
Thank You
Trapping multiple button elements on a webpage
- Chris Ruff
- Posts: 222
- Joined: Thu Apr 24, 2008 4:09 pm
- Location: topsail island, nc
- Contact:
Re: Trapping multiple button elements on a webpage
ExtractPostData()
is the magic function.
Generally speaking, if the button is pressed, if a text box is filled in, if a combo box is selected their names will show up in the post data when the form is Posted. You find their names in the list returned and for every button that is named, you execute the button function in your code down in C++
Chris
is the magic function.
Generally speaking, if the button is pressed, if a text box is filled in, if a combo box is selected their names will show up in the post data when the form is Posted. You find their names in the list returned and for every button that is named, you execute the button function in your code down in C++
Chris
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand
Re: Trapping multiple button elements on a webpage
Chris,
Thank you for the quick reply, I will take a look at the ExtractPostData() event handler function. I did just find reference to this in the NB Programmers Guide, and will refer to the example code.
Thanks Again,
Mark
Thank you for the quick reply, I will take a look at the ExtractPostData() event handler function. I did just find reference to this in the NB Programmers Guide, and will refer to the example code.
Thanks Again,
Mark
Re: Trapping multiple button elements on a webpage
Chris,
I was too quick on the submit button, and meant to add this comment for others. I was indeed using the ExtractPostData() function within the MyDoPost() event handler, however, I was not using it quite correctly. I was not refering to the pData passed over by MyDoPost(), thus not getting the available data from the webpage. Sections 8/9/10 of the NNDKProgMan.pdf references this capability quite clearly (too bad I didn't refer to it!).
Mark
I was too quick on the submit button, and meant to add this comment for others. I was indeed using the ExtractPostData() function within the MyDoPost() event handler, however, I was not using it quite correctly. I was not refering to the pData passed over by MyDoPost(), thus not getting the available data from the webpage. Sections 8/9/10 of the NNDKProgMan.pdf references this capability quite clearly (too bad I didn't refer to it!).
Mark