alohatofu Posted April 22, 2007 Share Posted April 22, 2007 <a href="javascript:freak_new()"> how can I assign let's say the title to the javascript button above? can I use <a href="javascript:freak_new?(<?php echo $title ?> )"> Link to comment https://forums.phpfreaks.com/topic/48170-passing-varaible-php/ Share on other sites More sharing options...
emehrkay Posted April 22, 2007 Share Posted April 22, 2007 yes Link to comment https://forums.phpfreaks.com/topic/48170-passing-varaible-php/#findComment-235536 Share on other sites More sharing options...
alohatofu Posted April 22, 2007 Author Share Posted April 22, 2007 Ok thanks so that worked. now <?php $testing = 2345 ?> <a href="javascript:freak_new(<?php echo $testing ?>)"> I have a form in javascript "freak_new" When a user clicked on that form I want to automatically fill in the value on that form. How would I do that? Thanks Link to comment https://forums.phpfreaks.com/topic/48170-passing-varaible-php/#findComment-235547 Share on other sites More sharing options...
emehrkay Posted April 23, 2007 Share Posted April 23, 2007 function freak_new(val){ document.getElementById('id of field').value = val; } Link to comment https://forums.phpfreaks.com/topic/48170-passing-varaible-php/#findComment-235657 Share on other sites More sharing options...
alohatofu Posted April 23, 2007 Author Share Posted April 23, 2007 I"m sorry but I dont' have a clue on what that means. Link to comment https://forums.phpfreaks.com/topic/48170-passing-varaible-php/#findComment-235661 Share on other sites More sharing options...
fenway Posted April 23, 2007 Share Posted April 23, 2007 It means settting a value. Link to comment https://forums.phpfreaks.com/topic/48170-passing-varaible-php/#findComment-235980 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.