getting the button from a Form

2009-07-15 Thread Marc Lerma
hello everyone, 

In my application, I need to get the id of a form button  when managing a POST 
call on a given resource.

this is my form i'm posting to my resource:

form name=login method=post action=/iwf-rest-client/login
Name:br
input type=text name=iwf.user_name cols=55 rows=10/textareabr
Password:br
input type=text name=iwf.user_password size=55 value=

input type=button name=submitButton value=Submit 
onclick=document.forms['login'].submit()

/form

and I'm getting it as follows:

@Post 
public Representation sendForm(Representation entity) {


Form form = new Form(entity);   

//get the names of the form fields
Set String names = form.getNames();
   
...
}

I'm being able to get all the field names but the button one, and I definitely 
need it. is there any means by which I can get the button name 
('submitButton')???


thanks in advance!

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2371432


getting the button from a Form

2009-07-15 Thread webpost
hello everyone, 

In my application, I need to get the id of a form button  when managing a POST 
call on a given resource.

this is my form i'm posting to my resource:

form name=login method=post action=/iwf-rest-client/login
Name:br
input type=text name=iwf.user_name cols=55 rows=10/textareabr
Password:br
input type=text name=iwf.user_password size=55 value=

input type=button name=submitButton value=Submit 
onclick=document.forms['login'].submit()

/form

and I'm getting it as follows:

@Post 
public Representation sendForm(Representation entity) {


Form form = new Form(entity);   

//get the names of the form fields
Set String names = form.getNames();
   
...
}

I'm being able to get all the field names but the button one, and I definitely 
need it. is there any means by which I can get the button name 
('submitButton')???


thanks in advance!

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2371431


Re: getting the button from a Form

2009-07-15 Thread Rhett Sutphin
Hi Marc,

On Jul 15, 2009, at 4:45 AM, Marc Lerma wrote:

 hello everyone,

 In my application, I need to get the id of a form button  when  
 managing a POST call on a given resource.

 this is my form i'm posting to my resource:

 form name=login method=post action=/iwf-rest-client/login
 Name:br
 input type=text name=iwf.user_name cols=55 rows=10/ 
 textareabr
 Password:br
 input type=text name=iwf.user_password size=55 value=

 input type=button name=submitButton value=Submit  
 onclick=document.forms['login'].submit()

The onclick handler here is why you aren't getting the  
submitButton=Submit value in the posted representation.  Use

input type=submit name=submitButton value=Submit

instead.

Rhett


 /form

 and I'm getting it as follows:

 @Post
 public Representation sendForm(Representation entity) {
   
   
   Form form = new Form(entity);   

//get the names of the form fields
Set String names = form.getNames();

...
 }

 I'm being able to get all the field names but the button one, and I  
 definitely need it. is there any means by which I can get the button  
 name ('submitButton')???


 thanks in advance!

 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2371432

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2371499