473,505 Members | 16,544 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pulling TextFields from a Form

Ok, This may sound like a noob question, but I have an application, that
asks the user to fill in fields from a pre-generated list of
possibilities. And upon clicking submit, the user is re-directed to a
page based off of their inputs into those fields.

Some of the code is

<form name="SomeForm">
<tr><td colspan="1"><img
src="default.aspx?uid=SomeID&coid=SomeOtherID&pgid =31&key=SomeKey"
alt="wonder if this shows up"><br><input type="textbox" name="SomeName"
value="This is an Answer"></td></tr>

<input type="button" value="Submit"
onclick="window.location.href=('default.aspx?uid=S omeID&coid=SomeID&pgid=32');"></input>
</form>

And once clicked, a new function is called.

But when I do a

Dim req As HttpRequest
sSQL.Append(req.Form("SomeName"))

I get a NullReference exception, as if it doesnt recognize the form, is
it because the Button was allready clicked? Or how can I pull the data
from the textfields, if im not actually posting them anywhere, just
using the Submit as a... 'move forward' in the process.

Thanks in advance for any help someone can offer.
Nov 21 '05 #1
1 1215
The NullReferenceException is because your variable 'req' is not set to
anything. All you do is declare it. And right on the next line try to use
it. But you never actually set it to an instance of an object.

You should either use the current request object, or if you declared the
textbox as runat="server", you can just refer to the textbox by its name.

"Rich Wahl" <ri**********@easybenefits.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Ok, This may sound like a noob question, but I have an application, that
asks the user to fill in fields from a pre-generated list of
possibilities. And upon clicking submit, the user is re-directed to a
page based off of their inputs into those fields.

Some of the code is

<form name="SomeForm">
<tr><td colspan="1"><img
src="default.aspx?uid=SomeID&coid=SomeOtherID&pgid =31&key=SomeKey"
alt="wonder if this shows up"><br><input type="textbox" name="SomeName"
value="This is an Answer"></td></tr>

<input type="button" value="Submit"
onclick="window.location.href=('default.aspx?uid=S omeID&coid=SomeID&pgid=32');"></input>
</form>

And once clicked, a new function is called.

But when I do a

Dim req As HttpRequest
sSQL.Append(req.Form("SomeName"))

I get a NullReference exception, as if it doesnt recognize the form, is it
because the Button was allready clicked? Or how can I pull the data from
the textfields, if im not actually posting them anywhere, just using the
Submit as a... 'move forward' in the process.

Thanks in advance for any help someone can offer.

Nov 21 '05 #2

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

Similar topics

3
2603
by: R.G. Vervoort | last post by:
I would like to select an option in a pulldown, select a record in a mysql database depending on the pulldown selection and then put the data from the record in the textfields. I can retrieve...
1
1994
by: Markus | last post by:
Hi, I am trying to query the value of a textfield outside of a form but with no success so far... the reason why I am not using a form is that there seams to be an annoying issue with hitting...
3
1591
by: frizzle | last post by:
Hi there, I'm building a multi-language PHP/mySQL -site. I'm also building a CMS for the site. There are 5 languages. In the CMS fields for e.g. english bodytext are called (id=)...
1
1909
by: Ed | last post by:
Hi, I have an html page with a div element within a form for dynamically creating textfields. The problem is when I click a link on the page, or the submit button, then click the back button,...
0
1258
by: chandutp | last post by:
hi i am new to this forum can i populate datagrid items of asp page to another asp page having textfields. in this datagrid userId is the index key by which it referenced.and i am using edit...
1
1822
by: eureka | last post by:
Hi folks, I am working on a webapplication using Jsp and JS. On my main Jsp(Jsp1) I have a table which is created dynamically inside a <divand contains all the backend-table's records as rows,...
3
2463
by: nicky77 | last post by:
Hi there, newish to javascript so grateful for any help. I am creating a test generator and have an array of textfields ("answer") created by a simple piece of PHP code. As you can see, I have...
3
2962
by: bravephantom | last post by:
In my project "scientific calculator", im using 2 textfields in my GUI app. the problem now (or actually what i dislike) is the user has to use the 2 textfields even if he needs a function of only 1...
5
2088
by: Kevin R | last post by:
How do you create those small textfields that I see for inputing passwords and such? Kevin
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7307
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7370
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...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3177
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.