logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Spry
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 11-05-2009, 08:14 PM   #1
deafboyzaudio
 
Join Date: Jul 2009
Location: west coast, U.S.A.
Posts: 176
Default Init val satisfing spry required text area

I have this code:
Code:
<textarea name="setup" cols="30" rows="2" class="indent" id="setup" tabindex="80" onfocus="if(this.value == 'Give a brief description of your Car Audio upgrades...') {this.value = '';}">Give a brief description of your Car Audio upgrades...</textarea>
That particular text area has the 'initial value' as you can see.... and that text area is required to have text in it by way of spry.

My issue is this... if the user skips over this text area, the spry thinks that the initial value is actually what the user types in, so it doesnt throw an error...

how do i make it so that spry sees this init val as no value at all?

thanks
deafboyzaudio is offline   Reply With Quote
Old 11-05-2009, 11:20 PM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,164
Default

you could look at the validation and add if field==' ',
add
|| field == "
Give a brief description of your Car Audio upgrades..."
hard to asay exactly without seeing the validation but that as an idea should work i would say
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas

Last edited by edbr; 11-05-2009 at 11:23 PM..
edbr is offline   Reply With Quote
Old 11-06-2009, 02:41 AM   #3
deafboyzaudio
 
Join Date: Jul 2009
Location: west coast, U.S.A.
Posts: 176
Default

OK when you say add that to the validation do you mean the spryValidationTextarea.js file in the spry assets folder? I would post that file up here but its 1000 lines.

I'm not too good at hand coding like that... I couldnt help notice that there was "Spry.Widget.ValidationTextarea.ONSUBMIT = 4;" in that file... I was thinking something like that might work... if i could code something like
Code:
on submit="if(this.value == 'Got ideas for site content? Link to it here...') {this.value = '';}"
to me that works but to DW it doesnt...

Im still a hand coding noob so please guide me along...
deafboyzaudio is offline   Reply With Quote
Old 11-06-2009, 03:56 AM   #4
DWcourse
DWcourse's Avatar
 
Join Date: Apr 2009
Posts: 3,276
Default

If I understand what's going on, you don't want to use an initial value for the field. Select the whole Spry area (it should be wrapped in a <span id="sprytextfield1"> tag) and in the Properties Inspector apply a hint instead.
__________________
If my answer helped, check out DWcourse.com for Dreamweaver tips and tutorials.
DWcourse is offline   Reply With Quote
Old 11-06-2009, 04:41 PM   #5
deafboyzaudio
 
Join Date: Jul 2009
Location: west coast, U.S.A.
Posts: 176
Default

Ok did that and it works. Thanks a lot DWcourse!!!!

I did have one other question though regarding some other spry options if you guys dont mind....
Code:
<label for="song" class="margin">Song Name:</label>
        <br />
        <span id="sprytextfield2">
  <input name="song" type="text" class="indent" id="song" tabindex="20" size="13" maxlength="30" />
  <span class="textfieldRequiredMsg">Required</span></span>
        
<label for="artist">Artist:</label>
        <span id="sprytextfield1">
          <input name="artist" type="text" id="artist" tabindex="30" size="13" maxlength="30" />
          <span class="textfieldRequiredMsg"></span></span>
        
<input type="checkbox" name="unknown" id="unknown" tabindex="" />
        <label for="unknown">Unknown</label><p>
Thats some code for a differnt part.... I want the song name and artist required with spry, but if the user checks the 'unknown' box, I want those text fields to not be required....
would this be done with javascript or a php if statement? can you give a hint to how that might be done? Thank you much
deafboyzaudio is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:44 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com