Changing button's URLs based upon text field

Ask a Question related to Macromedia Dreamweaver, Design and Development.

  1. #1

    Default Changing button's URLs based upon text field

    I have created a quiz using the Coursebuilder extensions in DWMX, which puts their score in a text field on the page (no data base is used). What I would like is if they score an 80 or higher, the Next button would direct them to one html page, but if they failed (79 or lower) the same Next button would direct them to a different page. Any ideas?



    cooped webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. Dinamically changing the Text Field of a LinkButton in a DataGrid
      Hello, I've run into a problem and I'm not sure if this is a limitation of dotNet or I'm doing something bad, I've a TemplateColumn in a...
    2. Changing text in a text field
      I have another noob question, I'm trying to change the text in a filed depending on what the user clicks on. What's the line of code I need to...
    3. display text field based on the selection choices
      I want to display credit card fields when the user selects the option paid membership. If user selects the option free membership, then the credit...
    4. SQL SELECT Based on *PART* a text Field?
      Hello, I'm trying to figure out some SQL here and am wondering this: Is it possible to select data based on a sub-string of a text field? ...
    5. Button's text
      Hi, I'm using a button, generated in the code behind: Dim button As New System.Web.UI.HtmlControls.HtmlButton button.Attributes.Add("value",...
  3. #2

    Default Re: Changing button's URLs based upon text field

    "cooped" [email]webforumsuser@macromedia.com[/email] wrote:
    > I have created a quiz using the Coursebuilder extensions in DWMX, which puts their score in a text field on the page (no data base is used). What I would like is if they score an 80 or higher, the Next button would direct them to one html page, but if they failed (79 or lower) the same Next button would direct them to a different page. Any ideas?
    Add this to the button (if it is submit, change it to button):

    onClick="checkScore()"

    then add this to the page:
    <script>
    function checkScore(){
    d=document.myFormName.myTestScoreFieldName.value
    window.location=(d<80)?'urlforlessthan80.html":"ur lform80plus.html";

    }
    </script>

    Replace the myFormName with your form's name (sometimes form1) and
    replace the myTestScoreFieldName with your test score field name.

    ================
    Paul Davis
    [url]http://www.kaosweaver.com/[/url]

    Visit for an extension or a few.
    Home of the inTensa Design Gallery and the Calendar Popup Behavior.

    Kaosweaver Extension Support:
    [url]http://www.kaosweaver.com/forum/[/url]

    Kaosweaver Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139