Showing posts with label fields. Show all posts
Showing posts with label fields. Show all posts

Saturday, March 31, 2012

submitting a PDF form

I have a pdf form with form fields. I want to submit the values and post them to a database. I created a save button and the action is "Submit form". It calls an aspx file. When I try to write out the request variables I get none. For some reason none are getting posted. What am i doing wrong?
I have been trying to figure this out for quite some time and I am getting a bit frustrated, any help would be greatly appreciated.
Thanks.Code would be useful. What does the command look like that's attempting to write to the db? Is the information supplied to gain access to the db correct? Are the table/field names correct? Is your syntax correct?
The reason that I didnt bother posting any code is because I am getting stuck before the point that I try to put the info into the db. I cant even retrieve the form variables
Request.form("name of filed from pdf form")
this value gives me nothing.
My question is if there is something that I am supposed to be doing in the PDF form that should make this work.
thanks.
http://www.tgreer.com/pdfSubmit.html

Submitting value from a hidden form field

I have a form inserting into an access database, 1 of the fields is hidden and required.
When I click submit the insert fails, if I change the visible value to "true" the insert succeeds.
I know this is probably really simple but I can't figure it out.If you set a controls visibility to false then it doesn't appear in the rendered HTML, therefore your hidden field won't be there at all (check the HTML source). In order to make a control still contain a value but be readonly try using the enabled property and set it to fale instead eg

<asp:TextBox id="myTextBox" enabled="false" runat="server"/>

That way the value is retained but it can't be changed.

Other option is to use a 'traditional' <input type="hidden"> field.
Thanks but the value has to be editable. The hidden field is actually receiving a date that is selected from a calendar on the page using this:


void Selection_Change(Object sender, EventArgs e)
{
countDate.Text = calendar.SelectedDate.ToShortDateString();
}

Where countDate is the hidden field.

If there is an easier way to do this please let me know.
As was explained,

you could use:

<input type="hidden"runat="server" ID="countDate"
Then just the code would be:


countDate.Value = calendar.SelectedDate.ToShortDateString();

Thanks, that worked.

I now have another problem, when changing the date on the calendar it appears to be trying to submit the form, causing error messages as some other fields are also required.