View Full Version : Resolved instead of onchange

11-26-2012, 06:28 AM
I have an input like this

<input type="text" name="handle" id="handle" size="20" value="<?=$_SESSION['post']['txtHandle'];?>" tabindex='1' onchange="toggle_handle(this.value)" />

the issue is that i am now changing that to a auto generated value so i had to change it to readonly and in doing so now my onchange wont work because im not inputing the value so it does not see the change.

<input type="text" readonly="readonly" name="handle" id="handle" size="20" value="<?=$_SESSION['post']['txtHandle'];?>" tabindex='1' onchange="toggle_handle(this.value)" />

//need to execute it here or in the input if i can

Question is what can i use to execute the toggle_handle now. What are my option, i obviously cant use onchange, and onfocus and onblur is out im sure because it is readonly. I tried onload just to test but that dont work lol

Any suggestions in order to excute that right after its loaded


UPDATE i did get the onclick to work but you have to click on it, but thats ok its better than nothing. if i just put the call to the function it wont execute until the form is done and thats not what i want. I wish there was a way to just let it execute in exactly the same manner as the onchange but allow it to sense the onchange automatically.

11-26-2012, 07:19 AM
Simply put the code at the bottom of the web page so it runs as toon as the HTML finishes loading

11-26-2012, 07:40 AM
Thanks i tried that but didnt work.

here is the bottom of my page its split into several sections this is the first process section for a multi form

//finish up page one below

</td></tr></table></div><div class="page-bottom"></div><br /><div align="right"> <input type="image" src="<?=$SKIN_IMAGE_PATH?>/step2.gif" name="Submit" value="Continue to STEP 2 >>" style="color:#71293e" tabindex="8"></div>

//footer that has some html in it

<!-- this should run after page loads as soon as the html is done -->
<script type="text/javascript">

}//end of page, last php command nothing further on page at all

11-26-2012, 02:57 PM
What i ended up doing is just not using the ajax listener for that event. I just hard coded the php and js in that section rather that use the ajax.

Thanks :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum