Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Contributor
Posts: 18
Registered: ‎12-20-2010
My Device: bold
My Carrier: webmaster

Widgets and forms

[ Edited ]

Hi,

 

I'm coding my first widget, it's composed by 1st page with a form and a second page who displays the results of the form after some operations.

 

I pass data from the form to the second page using GET (because we can't use POST).

 

So I pass to the URL a string like :

 

results.html?fieldOne=100&fieldTwo=2&fieldThree=12&submit=ok

 

On my 2nd page I use :

 

nReq = location.search.substring(1,location.search.length);

 

to split the the results and store them to vars.

 

But I can't recuperate the values, and when I do a document.write(nReq) it's blank.

 

What is the problem ? Is it possible to pass data from a page with a form to a second page ?

 

Thanks for your support,

 

Michel

Highlighted
Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Widgets and forms

Try using the URL parsing utility to pull your values out..

 

http://www.blackberry.com/developers/docs/widgetapi/blackberry.utils.URL.html

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter