Yii Framework Forum: Passing value from form to form - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Passing value from form to form Rate Topic: -----

#1 User is offline   Jay-ar 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 11-August 11

Posted 24 January 2012 - 03:32 AM

Hi.. Please help me

First in my index page there is a form like this:
____________________________________________________

Register

Fields with * are required.

First Name *
[textbox here]

Password *
[textbox here]

Email *
[textbox here]

Gender * oMale oFemale

[Register button]
_____________________________________________________

if register button is clicked the inputs should be validated and if all the inputs are valid this will proceed to the next form passing all of its input value to this from

____________________________________________________________________________________

Create Useraccounts
Fields with * are required.

First Name *
[textbox here] ---->this should contain the value from previous form

Last Name *
[textbox here]

Password *
[textbox here] ---->this should contain the value from previous form

Password Repeat
[textbox here]

Email *
[textbox here] ---->this should contain the value from previous form

Gender * Male Female ---->this should contain the value from previous form

Seeking a * Male Female

Date of Birth *
[textbox here]

Country *
[dropdownbox here]

State/Province *
[dropdownbox here]

City *
[dropdownbox here]

[Continue Button]
______________________________________________________________________________________
0

#2 User is offline   Ivica 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 321
  • Joined: 25-May 11

Posted 24 January 2012 - 03:48 AM

In controller action for first form, after successful validation, you can redirect control to another action:
$this->redirect( array('site/next_action','first_name'=>$first_name,...));

And then in view of next_action, load those parameters.
#Be Limitless
Gravity4
0

#3 User is offline   Ivica 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 321
  • Joined: 25-May 11

Posted 24 January 2012 - 03:49 AM

There is one more way, using sessions, but I think the way I suggested above is easier to implement.
#Be Limitless
Gravity4
0

#4 User is offline   Jay-ar 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 11-August 11

Posted 24 January 2012 - 03:52 AM

I already did that...the problem is when I am passing the value of password it will appear in the url...
0

#5 User is offline   Jay-ar 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 48
  • Joined: 11-August 11

Posted 24 January 2012 - 04:02 AM

and the other problem is about validation,, On the first form it will prompt an error that date of birth,country, province, city is required, because that was defined in my rules needed for the validation in the second form.
0

#6 User is offline   Bluenica 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 19-February 13

Posted 03 March 2013 - 03:23 AM

View PostIvica, on 24 January 2012 - 03:48 AM, said:

In controller action for first form, after successful validation, you can redirect control to another action:
$this->redirect( array('site/next_action','first_name'=>$first_name,...));

And then in view of next_action, load those parameters.


how exactly are you supposed to load the parameters?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users