SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru deepM's Avatar
    Join Date
    Dec 2007
    Location
    India
    Posts
    705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Preview form content on same page

    Hello,

    I have shout box on my profile page. I want to show a user preview before the post actually gets shouted. and on the confirm button i want to add that shout.

    1) can we do that on the same page?

    2) is it possible to do this without refreash?

    here is my bit code(or logic)

    PHP Code:
    <label for="comname">Name</label>
    <div><input type="text" name="comname" id="comname" size="25" readonly="readonly" value="<?=$authorinfo->username;?>" class="textfield" /><label class="errorText" id="validName"><?=$comnameErr;?></label></div>

    <label for="message">Message</label>
    <div><textarea name="message" id="message" cols="20" rows="4" class="textfield" onKeypress="textCounter(this,150);"><?$message;?></textarea></div>
    </fieldset>
    <div class="fm-submit"><input type="submit" name="shout" value="Shout" class="shoutBtn" onClick="javascript:return validateMsg(messageFrm);"/></div>


     <?if(isset($_POST['shout']) == "Shout"){?>
    <div><textarea name="message" id="message" cols="20" rows="4" class="textfield" onKeypress="textCounter(this,150);"><?$message;?></textarea></div>
    </fieldset>
    <div class="fm-submit"><input type="submit" name="confirm" value="Confirm" class="shoutBtn" onClick="javascript:return validateMsg(messageFrm);"/></div>
    <??>
    </form>
    but it showing me both the boxes. that i dont want.

    can anyone tell me how can i do that?

    Thanks in advance.

  2. #2
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Deepson2, try wrapping
    <?if(!isset($_POST['shout']) == "Shout"){?> around the top code block

  3. #3
    SitePoint Guru deepM's Avatar
    Join Date
    Dec 2007
    Location
    India
    Posts
    705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for your reply melbs.com,

    Now what is happening you know. when i click on shout shout box is replaces with confirm box. but i want to show both the boxes don't want to replace it actually.

    confirm box
    (confirm)button
    |
    -
    shout box
    (shout)button

    please help me.

  4. #4
    SitePoint Guru deepM's Avatar
    Join Date
    Dec 2007
    Location
    India
    Posts
    705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    sorted out the problem.


Bookmarks

Posting Permissions

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