close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

using dynamic text for hidden field....

Thread began 9/12/2012 9:48 am by JamieEff | Last modified 9/14/2012 1:17 pm by Jason Byrnes | 1830 views | 11 replies |

JamieEff

using dynamic text for hidden field....

Hi Jason

I am trying to add dynamic text to a hidden field in a form so that the received email will show that hidden content. The form is submitting fine but the hidden content is blank....

html:
<form id="activityproblem" name="activityproblem" method="post" action="process-activity.php">
<strong>Please let us know if you think there is an issue with any of the above activities.</strong><br />
<input type="hidden" name="client" value="<?php echo $row_Activities['UserFirstName']; ?>">
<label for="comments">Comments</label>
<textarea name="comments" rows="" cols="" ></textarea>
<input type="submit" name="submit" id="submit" value="Submit" />
</form>



TIA

Jamie

Sign in to reply to this post

Jason ByrnesWebAssist

that would mean the Activities recordset is not returning any records.

how is the Activities recordset configured?

Sign in to reply to this post

JamieEff

It is returning correctly for some content earlier in the page using the same reference:
<h1><?php echo $row_Activities['UserFirstName']; ?></h1>

am I not able to re-use for the hidden content on the form?

Sign in to reply to this post

Jason ByrnesWebAssist

what if you change the hidden element to a text field:

<input type="text" name="client" value="<?php echo $row_Activities['UserFirstName']; ?>">

does that show the value?

if so how have you set up the email body?

Did you select to create a file for the email and use one of the templates.

It would be more helpful to have a copy of the entire page rather than just the form snippet so i could see the code in context.

Sign in to reply to this post

JamieEff

hey Jason

I tried what you said and if you put content in the field it does get submitted through the form...

have attached the page and the form in question is near the bottom

thanks

Jamie

Attached Files
form.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the form comes after the reapet region:


<!----------->
<?php do { ?>
<div style="font-size:14px;font-weight:normal; clear:both;padding:5px 0 5px 0; overflow:auto;background-color:#fff;">
<div style="float:left;width:75px;margin:0 0 0 4px;"><?php echo date("d/m/y",strtotime( $row_Activities['ActivityDate'])); ?></div>
<div style="float:left;width:185px;margin:0 0 0 4px;"><?php echo $row_Activities['ActivityItem']; ?></div>
<div style="float:left;width:295px;margin:0 0 0 4px;"><?php echo $row_Activities['ActivityDescription']; ?></div>
<div style="float:left;width:40px;;margin:0 4px 0 0;">£<?php echo number_format($row_Activities['ActivityCost'],2); ?></div>
<div style="float:right;width:30px;;margin:0 0 0 7px;">
<?php if(WA_Auth_RulePasses("Administrator")){ // Begin Show Region ?>
<form action="clientarea-activity.php" method="post" >
<input name="Submit" type="image" id="Submit" src="images/misc/delete.jpg" width="20" height="20" alt="Delete"/>
<input name="deleteID" type="hidden" value="<?php echo $row_Activities['ActivityID']; ?>">
<input name="CID" type="hidden" value="<?php echo $_GET['CID']; ?>">
</form>
<?php } // End Show Region ?>
</div>
</div>
<?php } while ($row_Activities = mysql_fetch_assoc($Activities)); ?>
<!----------->

</div>
<div style="padding:20px;background-color:#ccc;margin-top:20px;text-align:center;">
<strong>Please let us know if you think there is an issue with any of the above activities.</strong><br />
<form id="activityproblem" name="activityproblem" method="post" action="process-activity.php">
<input type="hidden" name="client" value="<?php echo $row_Activities['UserFirstName']; ?>">
<input type="hidden" name="success_msg" value="Thank you for your query. We'll be in touch shortly." />
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="13%" align="left" valign="middle">Comments:</td>
<td width="71%"><textarea name="comments" cols="58" rows="3" ></textarea></td>
<td width="16%" valign="middle"><input type="submit" name="submit" id="submit" value="Submit" /></td>
</tr>
</table>

</form>


after the repeat region, the recordset is on an empty pointer so does not contain a value.

the form should be inside the repeat region.

Sign in to reply to this post

JamieEff

if i put that form within the repeat region the form it doesnt work...basically it shows multiple forms (as many as there are entries showing from the repeat region) - obviously I have misunderstood something.....

also, if the repeat region needs to surround it, why would it not be needed on line 144 between the h1 tags?

php:
<!-----Print Page------>

          <div style="clear:right;float:right;margin-bottom:15px;"><a href="javascript:window.print()">Print page<img  src="images/misc/print.jpg" alt="print" width="20" height="20" border="0" style="margin:0 0 0 5px; vertical-align:middle;"></a></div>
          <div style="margin-bottom:15px;">
            <h1><?php echo $row_Activities['UserFirstName']; ?></h1>
          </div>
Sign in to reply to this post

Jason ByrnesWebAssist

  if i put that form within the repeat region the form it doesnt work...basically it shows multiple forms (as many as there are entries showing from the repeat region) - obviously I have misunderstood something.....  




obviously I have misunderstood something myself.

What is it you are trying to do with this form? do you want the hidden element to contain the First name from the first record of the recordset?

The basic problem is this:

The form is after the repeat region.

once the repeat region loops through the recordset, the recordset is at the end, on an empty pointer.


your H1 tag works because it is before the repeat region, before the repeat region, the recordset is on the first record. so the h1 shows the first name contained in the first record?

is this what you want in the hidden element? the first record value? if so, you need to reset the recordset to beginning;

php:
<?php
mysql_data_seek
($Activities0);
$row_Activities mysql_fetch_assoc($Activities);
?>
Sign in to reply to this post

JamieEff

where would i put that Jason?

Sign in to reply to this post

Jason ByrnesWebAssist

just be fore the form...

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...