/    Sign up×
Community /Pin to ProfileBookmark

multistep form page

as i am sure most of you have read AT LEAST one post of mine involving this, my situation has yet to improve all of that much. all of the information i have been receiving from everyone has been great and has led me closer and closer to achieving what i want but I just can’t seem to get there overall. As i mentioned yesterday i am using a class i wrote using the ZervWizard.class.php from phpriot.com and have used his example to create my own class. The form works extremely well, except I am unable to process any checkboxes or radio buttons and i don’t know why. i cannot print or echo their values or anything and i don’t know why. here is the format that the ZervWizard class takes variables, and how i am trying to display them.

[CODE]$SendReports = $this->coalesce($form[‘SendReports’],”);
$this->setValue(‘SendReports’, $SendReports);
SendReports is a set of 3 radio buttons

<b>List Administrator Reports:</b>
<?= $wizard->getValue(‘SendReports’)?>

This displays the values of regular text boxes and drop down menus fine, but will not work for this radio button or checkbox situation.
[/CODE]

anyone have any ideas?

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@BWWebDesignsJan 17.2007 — any chance you can show me what the code you are using to display these check boxes etc in teh firt pace when the user has the option of clickng on them

that might help see if theres anthing wrong at that stage that needs fixing
Copy linkTweet thisAlerts:
@NickG21authorJan 18.2007 — [CODE] <input type="radio" name="MailingListServiceLevel[]" value="Standard" checked/> <a href="announcement-email-standard.html" target="_blank">Standard</a><br>
<input type="radio" name="MailingListServiceLevel[]" value="Professional" /> <a href="announcement-email-professional.html" target="_blank">Professional</a><br>
<input type="radio" name="MailingListServiceLevel[]" value="Enterprise" /> <a href="announcement-email-enterprise.html" target="_blank">Enterprise</a>

<input type="radio" name="SendReports[]" value="Daily" checked>Daily<br>
<input type="radio" name="SendReports[]" value="Weekly">Weekly<br>
<input type="radio" name="SendReports[]" value="Monthly">Monthly<br>

[/CODE]
Copy linkTweet thisAlerts:
@BWWebDesignsJan 18.2007 — yeah i dont se anything wrong there myself

i ndont know why but wheni use form elements i always put name="something" and also use id="something" not sure fo that makes a difference but hey worth a try
Copy linkTweet thisAlerts:
@NightShift58Jan 20.2007 — I think that the problem has to do with the fact that you're using the array form ([]) of defining the radio buttons. Try it without:[code=php]<input type="radio" name="MailingListServiceLevel" value="Standard" checked/> <a href="announcement-email-standard.html" target="_blank">Standard</a><br>
<input type="radio" name="MailingListServiceLevel" value="Professional" /> <a href="announcement-email-professional.html" target="_blank">Professional</a><br>
<input type="radio" name="MailingListServiceLevel" value="Enterprise" /> <a href="announcement-email-enterprise.html" target="_blank">Enterprise</a>

<input type="radio" name="SendReports" value="Daily" checked>Daily<br>
<input type="radio" name="SendReports" value="Weekly">Weekly<br>
<input type="radio" name="SendReports" value="Monthly">Monthly<br>[/code]
What you want out of this is 1 variable with 1 of 3 possible values. By defining them as arrays, you're really getting something completely different.
Copy linkTweet thisAlerts:
@NickG21authorJan 22.2007 — that works excellent, i have been messing with the syntax of that for days, i thought it was necessary to include the array tags. the only problem i am still having is that checkboxes with an onClick event does not store the value in them such as.....

[CODE]<input name="BillingInformation" type="checkbox" value="Yes" onClick="DisableControlGroup(this, SameContact)">[/CODE]

and this is the code for the function it calls

[CODE]function DisableControlGroup(check, group)
{
var x, opt;
if(check.checked)
{
opt = true;
}
else
{
opt = false;
}
for(x=0; x < group.length; x++)
{
group[x].disabled = opt;
}
}[/CODE]


thanks for your other information!
Copy linkTweet thisAlerts:
@phpnewbie08Jan 29.2009 — Hi NickG21,

I had been trying to use the phpriot wizard to create multistep form for days but has no clue how to implement it. Can you please show/describe how you use it? I have read the instruction/steps on the phpriot page many times just couldn't figure out what to do to make it work. I will really appreciate it.
Copy linkTweet thisAlerts:
@sarah_9Jan 31.2009 — that works excellent, i have been messing with the syntax of that for days, i thought it was necessary to include the array tags. the only problem i am still having is that checkboxes with an onClick event does not store the value in them such as.....

[CODE]<input name="BillingInformation" type="checkbox" value="Yes" onClick="DisableControlGroup(this, SameContact)">[/CODE]

and this is the code for the function it calls

[CODE]function DisableControlGroup(check, group)
{
var x, opt;
if(check.checked)
{
opt = true;
}
else
{
opt = false;
}
for(x=0; x < group.length; x++)
{
group[x].disabled = opt;
}
}[/CODE]


thanks for your other information![/QUOTE]


Hello,

Hey buddy thanks for sharing this , i needed it badly,


Regards,

sarah_9

Outsource PHP projects
×

Success!

Help @NickG21 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...