I dont know if I'm in the right place but I am a complete newbie to ASP but have managed to put together an emailer but am having problems with the submission.
Basically, on the form (which is here http://www.motley.co.uk/contact_test.asp) I have 3 required fields (name, email and telephone). Now, if I input text into all the fields except, for example, telephone, then anything after a space in the name field gets omitted (i.e. the surname is lost when asking for the further info to be submitted). Also, i lose the text input in the web address area.
If anyone can make head or tail of the above, or even better the page and offer me help I would be greatly appreciative!
hi,
you need to post the code for us to have a look, i filled in your form and it submitted ok, it never showed me what got submitted if anything, i was presented with a close window button which i pressed and your website closed down, is this ment to happen?
Sorry about that, I thought you could look at the code behind the page - is the following enough? It only happens when on e of the required fields is not completed and if someone has put in their first and last name as one of the fields to be submitted, then the last name gets 'cut off', also the web address gets returned as blank. Cheers, Jamie
IF name="" OR name="*" THEN
name_error="*"
error=1
END IF
IF telephone="" OR telephone="*" THEN
telephone_error="*"
error=1
END IF
IF email_address="" OR email_address="*" THEN
email_address_error="*"
error=1
END IF
I was just wondering if the value="" needs to be changed to value=<%=name%> (as it is in the original code) and if I do retain the latter do I need to change the case and change it to UserName?
Thanks again for all your help and, being completely clueless re ASP (but willing to learn!), apologise for any complete nonsense I come up with and also for the future questions re this code that I am trying to sort out
IF UserName="" OR UserName="*" THEN
name_error="*"
error=1
END IF
IF telephone="" OR telephone="*" THEN
telephone_error="*"
error=1
END IF
IF email_address="" OR email_address="*" THEN
email_address_error="*"
error=1
END IF
response.redirect("sent_test.asp")
END IF
END IF
%>
and to show you what I have in an input field:
<td><font color="#ff0000"><%=email_address_error%></font></td>
<td colspan="5"> <font color="#ffcc00">
<input type="text" name="email_address" size="30" value=<%=email_address%>>
</font> </td>
</tr>
<tr>
<td width="87"><font face="Helvetica, Arial, Verdana, Times New Roman" size="1" color="#ffcc00">Web
Address:</font></td>
<td valign="middle"> </td>
<td colspan="5" valign="middle"> <font color="#ffcc00">
<input type="text" name="web address" size="30" value=<%=web_address%>>
There are 3 'required' fields, UserName, email_address and telephone_number. If I input 2 of the 3 required fields and fillin the rest, it redirects back to the contact page but if, in the case of the username, you have 2 separate words it cuts off the second word and also it blanks all the other fields too.
Again, my apologies for being so thick but I just cant see what the problem is.
hi,
just a query and suggestion, do you really me to me trimming the input from the form for every form element your requesting?
Can i suggest you remove the trim for all of these and see how you get on.
There are 2 problems remaining,
1) the name still keeps getting cut down to the first name put in (i.e. if you input joe bloggs, on the redirect all you see is joe and bloggs has been omitted)
2) the 'your enquiry' section is in a textarea (as opposed to an input) and on a redirect is blanked also....
IF user_name="" OR user_name="*" THEN
user_name_error="*"
error=1
END IF
IF telephone_number="" OR telephone_number="*" THEN
telephone_number_error="*"
error=1
END IF
IF email_address="" OR email_address="*" THEN
email_address_error="*"
error=1
END IF
hi,
just looking at your code am im thinking either i have understood you correctly or your missing out something.
You have a page that the user files in the details, on submit you are submitting to the page you have shown the code for. On this page you retrieve the form objects using the request command then you create an email and automatically send the information. Once this is done do you then want to redirect to another page, then display then information that was sent or do you want to display information on the same page?.
Say you want to display the information on the page you redirected to then you would need to send the information via the querystring. You would need something like this:
This would work fine as long as your querystring is less than(i think) 255 characters long.
Most ASP developers prefer to use post back to get around this problem. Posting the form back to itself, then process the form then display a message all on the same page, would achieve the same results.
On this page you retrieve the form objects using the request command then you create an email and automatically send the information. Once this is done do you then want to redirect to another page, then display then information that was sent or do you want to display information on the same page?.
I'm not a 100% sure about the mechanics of the code, but as far as I see it, you input the details in the various fields, it then sends to itself to check that required fields are completed and then if they are then it emails the content and redirects the page to another page. If a required field is not completed then it reposts the contact page with asterisks on the fields that still need to be completed.
That all seems to be working, but, on closer insepction, ALL the fields seem to get 'trimmed' to one word if there are more than one word in any of the fields so if the first address field has got 22 acacia avenue, all that gets displayed (either in the posted email or the contact page if it requires further fields to be completed, is the 22 without any of the other details. This seems to be doing it in all the fields and I dont understand.
Thanks for all your replies and help.....I have to say that I am a bit confused with it all and dont really understand the whys and wherefores!
With that in mind I will probably write it off as a bad experience (trying to use asp that is) and just keep it simple - I was just trying to enhance and improve my skillset!
I just tried to cobble together some code to do (what I thought was) a simple job and am obviously coming unstuck - sadly I am no closer to solving it (down to me and my head not the help that you have tried to give me).
I am posting to an ASP script and even though I am encoding the spaces to be %20 the receiving script claims not to have received the spaces.
Therefore Joe%20Bloggs comes out as JoeBloggs.
Unfortunately I do not have the source code, but is this a common problem? Would anyone know what the possible errors might be without seeing any code?
Bookmarks