Developer forum

Forum » Development » Problem with form and Base.Request

Problem with form and Base.Request


Reply

Hi,

I am making a custom module and I cannot get the values from the submitted form to my .cs file.

 

My form looks like this:

 

<form name="findExperiences" action="<!--@Global:Pageview.Url.Raw-->" method="post">
 <input name="languageID" type="hidden" value="<!--@languageID-->" />

 <select id="cityID" onchange="document.forms['findExperiences'].submit();">
  <option value=""><!--@SelectCity--></option>
  <!--@LoopStart(cityLoop)-->
  <!--@EmptyLoopStart--><option>INGEN BYER</option><!--@EmptyLoopEnd-->
  <option value="<!--@cityID-->"><!--@experienceCity--></option>
  <!--@LoopEnd(cityLoop)-->
     </select><input type="submit" value="<
    !--@SendLabel-->" />
</form>


The form looks ok when it is rendered with the appropiate values in cityID - but when I submit the form - my .cs file returns nothing.


Below is an abstract of my .cs file:
....

namespace Dynamicweb.BSExperiences
{
 [AddInName("BalticSailingExperiences")]
 public class BalticSailingExperiences : ContentModule
 {
  public override string GetContent()
  {
   int tempCityID = Base.ChkInteger(Base.Request("cityID"));

....

Am I missing something obvious?

Kind regards


Sonni


Replies

 
Nicolai Høeg Pedersen
Reply
Is the module "BalticSailingExperiences" registered and attached to a paragraph on the page you are submitting to?

http://devierkoeden.com/Articles/[articleId/16]/Custom-Modules---Part-3---7-Steps-to-Building-a-Custom-Module---Hands-On.aspx
 
Reply
Hi NP,

The module is registered and attached to a paragraph. The action tag points to itself - but the Base.Request("cityID") returns nothing.

ST
 
Reply
Hi again,

The error was mine (and somewhat stupid) - in the form I had: "..select id=cityID.." - and not "..select name=cityID..".

Thank You for Your help.


ST

 

You must be logged in to post in the forum