473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Form Submit Issue

Hi all,

I have a page which displays some database results. On each column heading
I have 2 images, an arrow up, and arrow down for my data sorting.

The problem I have is that at the moment, the user enters search criteria
into the search box and clicks the search image button to trigger the
search. I now need the arrows to also submit the search - not the end of
the world, I can make them image buttons, but I have no idea how to send
dynamic sorting instructions via the querystring from the click of that
image button?

Can anyone help me please.

Thanks in advance,

Regards

Rob
Nov 19 '05 #1
4 1014
I don't know if I'm understanding you correctly. But here's what I
think you should do.
First as you mentioned, make your images Image button controls. Then
you can do either one of these:
1. Return a dataset to fill your grid/table. Then when you click on the
soring image, just use the sort property of the defaultview element of
the dataset.
2. Call a different stored prcedure when you click the images.

In either case you don't need Querystring information, because you
won't be redirecting, but posting back to the same page.

I hope that helps

Nov 19 '05 #2
"Hugo Flores" wrote ...
I don't know if I'm understanding you correctly. But here's what I
think you should do.
First as you mentioned, make your images Image button controls. Then
you can do either one of these:
1. Return a dataset to fill your grid/table. Then when you click on the
soring image, just use the sort property of the defaultview element of
the dataset.
2. Call a different stored prcedure when you click the images.

In either case you don't need Querystring information, because you
won't be redirecting, but posting back to the same page.


Hi Hugo,

Thank you for your reply.

I have a stored proc already, but it currently returns "under ordered", as I
have the DataView being sorted via the .Sort method.

I had assumed I'd need to trigger a reload of the page to resort, and as my
other page (not mentioned previously) resorts using a querystring (sending
the columns/order) to set the .Sort method I assumed I'd do it the same way.

I'm not sure whether I can do what you are suggesting though as my
ImageButtons for the sorting are being generated programmitcally, can you
add events for controls that are added programmaticaly?

Any further help appreciated.

Regards

Rob
Nov 19 '05 #3
I don't know if you can add an event to a dinamically generated
control. I'd say you can, but don't know how.
Now, if you want to send the information via the querystring. How about
generating the images as links, and then just look for the parameter
that you are sending to sort, and based on that you can use the sort
method of the dataview as you mentioned.

Nov 19 '05 #4
"Hugo Flores" wrote...
I don't know if you can add an event to a dinamically generated
control. I'd say you can, but don't know how.
Hi Hugo,

Yes, it appears you can...and cant...

You can use AddHandler to wire up and event handler to an event, ie
MyButton.Click etc

The problem is, from reading on the net, it seems that it only works if the
button is added in the Page.Load sub, not in any other subs of your own
(testing this at the moment), if so, this is no good to me...a work around
seems to be storing a value of the clicked item somewhere, say for example
in a form field or a session variable - just feels a sloppy way of doing
things to me..
Now, if you want to send the information via the querystring. How about
generating the images as links, and then just look for the parameter
that you are sending to sort, and based on that you can use the sort
method of the dataview as you mentioned.


Yeah, thats what I have on my "other" page, thats a nice one as it always
does the same thing, returns a specific set of results from the database, so
there I use the querystring/images to sort by, because there's no "form" as
such where the user can search, on this page however, if I do that then the
hyperlink on the image has to be something like:

MySearchPage.aspx?column=employee&order=desc

Downside of this is that then my search criteria is lost, as it is sent as a
form submission, more of a redirect.

I could of course put the search criteria in the querystring also, however
this is then changing my search page so much it doesn't feel like the right
solution (plus I'd have to add more validation of the querystring results,
and start populating form fields if there was a value in the querystring and
on it goes :))

Regards

Rob
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark Michel | last post by:
Hi. I have made an html form which I would like to send by e-mail. When the recipient receives the e-mail form, I would like them to be able to fill it out and click the Submit button which will...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
13
by: teddy.am | last post by:
I know this is stupid, but i've been trying to process a form while adding a function to the onClick event. as soon as i add the onClick event, the function is triggerred but the form doesn't...
4
by: Alex Sibilev | last post by:
Hello, I have a really weird problem I've been trying to solve it without any luck for the last couple of hours :( I'm writing a "conference board" application (quite similar to ASP.NET...
4
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page...
7
by: h7qvnk7q001 | last post by:
I'm trying to implement a simple server-side form validation (No Javascript). If the user submits a form with errors, I want to redisplay the same form with the errors highlighted. Once the form...
1
by: Nigel | last post by:
Hello, I am creating a Perl CGI page with Javascript which I believe has a problem with the javascript. Below is my form which has two submit buttons with two different actions. I am having...
16
by: browntown | last post by:
so I have this application I'm nearly finished with. The only thing the client has requested is the ability to submit the form by pressing "enter". I didn't think this would be a huge pain in the...
26
by: Jerim79 | last post by:
I need to create a form that takes a number that the user enters, and duplicates a question the number of times the user entered. For instance, if the customer enters 5 on the first page, when...
1
by: gbezas | last post by:
Hi All, I have added an event handler to redirect form.submit() to a newSubmit() method that I have defined (which does some additional processing before submitting the form). Additionally I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.