close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Reset Button

Thread began 1/25/2010 3:28 pm by FARRSX4397970 | Last modified 9/15/2010 12:19 pm by Jason Byrnes | 2237 views | 16 replies |

FARRSX4397970

Reset Button

Is there an easy way to add a reset button that looks like the submit image in the Contact form solutions pack. This is the text I have now.
<a href="contactus.php">Reset the Code</a>

Sign in to reply to this post

neilo

If you want a button that just resets the form (but won't reset the captcha image):

Insert > Form > Button - and in the Properties Panel/Inspector set the action to 'Rest Form'
Make sure that the button is inside the form tags.


If you want a button to refresh your form page (so that the form resets and the captcha image changes):

Insert a button - Insert > Form > Button
In Properties Panel/Inspector, for 'Action' select 'None' - give it a value, i.e 'Reset'.
Go to Window > Behaviors and in the Behaviors Panel, click the plus sign and from the options select 'Go to URL'. Enter 'contactus.php' for the URL.

Sign in to reply to this post

FARRSX4397970

Reset button

What if you just want captcha image to change only?

Sign in to reply to this post

Jimmy Wu

In your contact_styled.php page, you will have to find the image code:

<img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=<?php echo $WAGLOBAL_Captcha_Noise; ?>&bgcolor=<?php echo $WAGLOBAL_Captcha_BG; ?>&textcolor=<?php echo $WAGLOBAL_Captcha_Text; ?>&transparent=<?php echo $WAGLOBAL_Captcha_BG_transparent; ?>&characters=<?php echo $WAGLOBAL_Captcha_Characters; ?>&width=<?php echo $WAGLOBAL_Captcha_Width; ?>&height=<?php echo $WAGLOBAL_Captcha_Height; ?>&font=<?php echo $WAGLOBAL_Captcha_Font; ?>" alt="security code"/>



Add an id to it like this:

<img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=<?php echo $WAGLOBAL_Captcha_Noise; ?>&bgcolor=<?php echo $WAGLOBAL_Captcha_BG; ?>&textcolor=<?php echo $WAGLOBAL_Captcha_Text; ?>&transparent=<?php echo $WAGLOBAL_Captcha_BG_transparent; ?>&characters=<?php echo $WAGLOBAL_Captcha_Characters; ?>&width=<?php echo $WAGLOBAL_Captcha_Width; ?>&height=<?php echo $WAGLOBAL_Captcha_Height; ?>&font=<?php echo $WAGLOBAL_Captcha_Font; ?>" alt="security code" id="captchaImage" />



Then you will have to add a script like this:

<script language="JavaScript">
function reloadImage() {
var now = new Date();
if (document) {
document.getElementById('captchaImage').src = "WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=" + "<?php echo $WAGLOBAL_Captcha_Noise; ?>" + "&bgcolor=" + "<?php echo $WAGLOBAL_Captcha_BG; ?>" + "&textcolor=" + "<?php echo $WAGLOBAL_Captcha_Text; ?>" + "&transparent=" + "<?php echo $WAGLOBAL_Captcha_BG_transparent; ?>" + "&characters=" + "<?php echo $WAGLOBAL_Captcha_Characters; ?>" + "&width=" + "<?php echo $WAGLOBAL_Captcha_Width; ?>" + "&height=" + "<?php echo $WAGLOBAL_Captcha_Height; ?>" + "&font=" + "<?php echo $WAGLOBAL_Captcha_Font; ?>" + "&time=" + now.getTime();
}
}
</script>



and a button that calls the reload function like this:

<input type="button" name="Button" id="button" value="Button" onclick="reloadImage()" />
Sign in to reply to this post

FARRSX4397970

Reset button

Thankyou worked great!

Sign in to reply to this post

phebberd116714

How do I style the image

I can get the button working following your instructions but the refreshed image I get is ugly and unreadable.

This is the code that generates my captcha image. It was created with form builder:

<img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?field=captchaField&transparent=false&noisecolor=99CCCC&noiseorder=0&gridfreq=25&gridcolor=FFFF00&gridorder=0&font=Fonts/MYTYPE.TTF&characters=6&textcolor=333333" alt="Security Code" class="Captcha" id="captchaImage" />

How do I translate that into the js script.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

change:

document.getElementById('captchaImage').src = "WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=" + "<?php echo $WAGLOBAL_Captcha_Noise; ?>" + "&bgcolor=" + "<?php echo $WAGLOBAL_Captcha_BG; ?>" + "&textcolor=" + "<?php echo $WAGLOBAL_Captcha_Text; ?>" + "&transparent=" + "<?php echo $WAGLOBAL_Captcha_BG_transparent; ?>" + "&characters=" + "<?php echo $WAGLOBAL_Captcha_Characters; ?>" + "&width=" + "<?php echo $WAGLOBAL_Captcha_Width; ?>" + "&height=" + "<?php echo $WAGLOBAL_Captcha_Height; ?>" + "&font=" + "<?php echo $WAGLOBAL_Captcha_Font; ?>" + "&time=" + now.getTime();



to:

document.getElementById('captchaImage').src = "WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?noisecolor=99CCCC&bgcolor=FFFF00&textcolor=333333&transparent=false&characters=6&font=Fonts/MYTYPE.TTF&time=" + now.getTime();
Sign in to reply to this post

elevy388997Beta Tester

Hope you can help me out here, I get the idea, but having different values than these examples is throwing me off. (just refresh the captcha image only)


<div class="fieldGroup"> <img src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?field=Contact_me_group_Security_code&width=140&height=50&bgcolor=000000&transparent=false&noisefreq=25&gridfreq=50&gridcolor=FFFFFF&gridorder=0&font=Fonts/MODERNA_.TTF&textcolor=990000" alt="Security Code" class="Captcha" /> </div>

Sign in to reply to this post

Jason ByrnesWebAssist

you just need to add an id to the image tag:

php:
<div class="fieldGroup"> <img  src="WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?field=Contact_me_gr oup_Security_code&width=140&height=50& bgcolor=000000&transparent=false&noisefreq =25&gridfreq=50&gridcolor=FFFFFF&grido rder=0&font=Fonts/MODERNA_.TTF&textcolor=990000" alt="Security Code" class="Captcha" id="captchaImage" /> </div>





and add the script as:

<script language="JavaScript">
function reloadImage() {
var now = new Date();
if (document) {
document.getElementById('captchaImage').src = "WA_ValidationToolkit/WAVT_CaptchaSecurityImages.php?field=Contact_me_gr oup_Security_code&width=140&height=50& bgcolor=000000&transparent=false&noisefreq =25&gridfreq=50&gridcolor=FFFFFF&grido rder=0&font=Fonts/MODERNA_.TTF&textcolor=990000";
}
}
</script>
Sign in to reply to this post

elevy388997Beta Tester

It works except it resets the formatting on the captcha. How to change that? contact.php

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...